Skip to content

Commit 243937c

Browse files
committed
docs/Updates: add RPi OS update and clarify wording
1 parent 732889a commit 243937c

File tree

2 files changed

+42
-19
lines changed

2 files changed

+42
-19
lines changed

docs/Updates/index.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ flowchart TD
1010
GIT --- GITPULL([$ git pull -r])
1111
GITPULL --> TEMPLATES["~/IOTstack/.templates"]
1212
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"]
1416
COMPOSE --- UP(["$ docker-compose up --build -d"])
1517
1618
HUB[hub.docker.com images and tags]
@@ -19,22 +21,29 @@ flowchart TD
1921
PULL --> CACHE[local Docker image cache]
2022
CACHE --- UP
2123
22-
UP --> CONTAINER[updated Docker containers]
24+
UP --> CONTAINER[running Docker containers based on the latest cached images]
2325
2426
classDef command fill:#9996,stroke-width:0px
2527
class GITPULL,MENU,UP,PULL command
2628
```
2729

28-
!!! note "Minor details"
30+
??? note "Minor details fudged in the graph"
2931

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:
3133

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).
3847

3948
## Backup and rollback
4049

@@ -54,13 +63,24 @@ save a complete disk image backup of its storage using another machine.
5463
For a hobby project, not having perfect rollback may be a risk you're willing
5564
to take. Usually container image problems have fixes/workarounds within a day.
5665

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+
5777
## Recommended: Update only Docker images
5878

5979
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.
6484

6585
Updating the IOTstack project templates and recreating your
6686
`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.
6989

7090
!!! tip "Recommended update procedure"
7191

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.
7698
2. Get latest images from the web:
7799
``` console
78100
$ docker-compose pull
@@ -110,7 +132,7 @@ Periodically updates are made to project which include new or modified container
110132
it to another machine. Reinstall your storage and power up your RPi.
111133
2. backup your current settings: `cp docker-compose.yml docker-compose.yml.bak`
112134
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`
114136
5. recreate the compose file and Dockerfile:s: `./menu.sh`, select Build Stack, don't change selections, press enter to build, and then exit.
115137
4. get latest images from the web: `docker-compose pull`
116138
5. rebuild localy created images from new Dockerfiles: `docker-compose build --pull --no-cache`

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ markdown_extensions:
6969
- name: mermaid
7070
class: mermaid
7171
format: !!python/name:pymdownx.superfences.fence_code_format
72+
- pymdownx.details
7273
- pymdownx.tabbed:
7374
alternate_style: true
7475
- toc:

0 commit comments

Comments
 (0)