@@ -10,7 +10,9 @@ flowchart TD
10
10
GIT --- GITPULL([$ git pull -r])
11
11
GITPULL --> TEMPLATES["~/IOTstack/.templates"]
12
12
TEMPLATES --- MENU([$ ./menu.sh -> Build stack])
13
- MENU --> COMPOSE["~/IOTstack/docker-compose.yml\n~/IOTstack/services/*/Dockerfile"]
13
+ MENU --> COMPOSE["~/IOTstack/docker-compose.yml
14
+ ~/IOTstack/.templates/*/Dockerfile
15
+ ~/IOTstack/services/*/Dockerfile"]
14
16
COMPOSE --- UP(["$ docker-compose up --build -d"])
15
17
16
18
HUB[hub.docker.com images and tags]
@@ -19,22 +21,29 @@ flowchart TD
19
21
PULL --> CACHE[local Docker image cache]
20
22
CACHE --- UP
21
23
22
- UP --> CONTAINER[updated Docker containers]
24
+ UP --> CONTAINER[running Docker containers based on the latest cached images ]
23
25
24
26
classDef command fill:#9996,stroke-width:0px
25
27
class GITPULL,MENU,UP,PULL command
26
28
```
27
29
28
- !!! note "Minor details"
30
+ ??? note "Minor details fudged in the graph "
29
31
30
- In order to keep the graph simple, some minor details fudged :
32
+ In order to keep the graph simple, some minor details were left unprecise :
31
33
32
- - `$ docker-compose pull` will read `docker-compose.yml`, in order to know
33
- what image tags to check for updates.
34
- - `docker-compose build --pull --no-cache` will use
35
- `~/IOTstack/.templates/*/Dockerfile` and
36
- `~/IOTstack/services/*/Dockerfile` and pull their referenced Docker
37
- images, if there are selected services using these Dockerfiles.
34
+ - `$ docker-compose pull` will read `docker-compose.yml`, in order to know
35
+ what image tags to check for updates.
36
+ - `$ docker-compose build --pull --no-cache` will use `docker-compose.yml`
37
+ to find which of the "build:" sources are in use:
38
+
39
+ * `~/IOTstack/.templates/*/Dockerfile`
40
+ * `~/IOTstack/services/*/Dockerfile`
41
+ * remote repositories with Dockerfiles
42
+
43
+ and pull Docker images referenced in these while building.
44
+ - `$ docker-compose up --build -d` may not require the "--build"-flag,
45
+ but having it won't hurt (and may help keep some corner-case problems
46
+ away, docker may be a bit finicky).
38
47
39
48
## Backup and rollback
40
49
@@ -54,13 +63,24 @@ save a complete disk image backup of its storage using another machine.
54
63
For a hobby project, not having perfect rollback may be a risk you're willing
55
64
to take. Usually container image problems have fixes/workarounds within a day.
56
65
66
+ ## Update Raspberry Pi OS
67
+
68
+ You should keep your Raspberry Pi up-to-date. Despite the word "container"
69
+ suggesting that containers are fully self-contained, they sometimes depend on
70
+ operating system components (WireGuard is an example).
71
+
72
+ ``` console
73
+ $ sudo apt update
74
+ $ sudo apt upgrade -y
75
+ ```
76
+
57
77
## Recommended: Update only Docker images
58
78
59
79
When you built the stack using the menu, it created the Docker Compose file
60
- ` docker-compose.yml ` . This file uses tag references (e.g. ` :latest ` ) to get the
61
- image for that tag from hub.docker.com. Thus when Docker is told to pull
62
- images, it will download and update it's local cache to the newest image. No
63
- need to update ` docker-compose.yml ` or ` Dockerfile ` s .
80
+ ` docker-compose.yml ` . This file or its linked ` Dockerfile ` s, use image name and
81
+ tag references (a missing tag defaults to ` :latest ` ) to get the images from
82
+ hub.docker.com. Likewise, when Docker is told to pull updated images, it will
83
+ download the newest image for the tags into its local cache .
64
84
65
85
Updating the IOTstack project templates and recreating your
66
86
` docker-compose.yml ` isn't usually necessary. Doing so isn't likely to provide
@@ -69,10 +89,12 @@ recommended when there is a new feature or change you need.
69
89
70
90
!!! tip "Recommended update procedure"
71
91
72
- 1. Shutdown your RPi, remove its storage medium and backup a full image
73
- of the storage to another machine. Reattach your storage and power up
74
- your RPi. To skip this step may cause a long downtime as you debug the
75
- problem.
92
+ 1. Shutdown your RPi, remove the storage medium and do a full backup
93
+ [image](https://www.howtogeek.com/341944/how-to-clone-your-raspberry-pi-sd-card-for-foolproof-backup/)
94
+ of the storage to another machine. Reattach the storage back and power
95
+ up your RPi.<br />
96
+ NOTE: To skip this step may cause days of downtime as you debug a
97
+ problem or wait for fixes.
76
98
2. Get latest images from the web:
77
99
``` console
78
100
$ docker-compose pull
@@ -110,7 +132,7 @@ Periodically updates are made to project which include new or modified container
110
132
it to another machine. Reinstall your storage and power up your RPi.
111
133
2 . backup your current settings: ` cp docker-compose.yml docker-compose.yml.bak `
112
134
3 . check ` git status ` for any local changes you may have made to project files, ignore any reported "Untracked files". Save and preserve your changes by doing a commit: ` git commit -a -m "local customization" ` . Or revert them using: ` git checkout -- path/to/changed_file ` .
113
- 4 . update project files from github: ` git pull origin master -r `
135
+ 4 . update project files from github: ` git pull -r origin master `
114
136
5 . recreate the compose file and Dockerfile:s: ` ./menu.sh ` , select Build Stack, don't change selections, press enter to build, and then exit.
115
137
4 . get latest images from the web: ` docker-compose pull `
116
138
5 . rebuild localy created images from new Dockerfiles: ` docker-compose build --pull --no-cache `
0 commit comments