Skip to content

Commit 7dc043e

Browse files
authored
Merge pull request #382 from Paraphraser/20210713-gettingStarted-master
20210713 documentation - getting started
2 parents 44f62e2 + fd1eb55 commit 7dc043e

File tree

1 file changed

+72
-7
lines changed

1 file changed

+72
-7
lines changed

docs/Getting-Started.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Andreas Spiess Video #352: Raspberry Pi4 Home Automation Server (incl. Docker, O
1515
IOTstack makes the following assumptions:
1616

1717
1. Your hardware is a Raspberry Pi (typically a 3B+ or 4B)
18-
2. It has a reasonably-recent version of Raspberry Pi OS (aka "Raspbian") installed which has been kept up-to-date with:
18+
2. It has a reasonably-recent version of 32-bit Raspberry Pi OS (aka "Raspbian") installed which has been kept up-to-date with:
1919

2020
```
2121
$ sudo apt update
@@ -29,7 +29,13 @@ IOTstack makes the following assumptions:
2929

3030
The first five assumptions are Raspberry Pi defaults on a clean installation. The sixth is what you get if you follow these instructions faithfully.
3131

32-
> Please don't read these assumptions as saying that IOTstack will not run on other hardware, other operating systems, or as a different user. It is just that IOTstack gets most of its testing under these conditions. The further you get from these implicit assumptions, the more your mileage may vary.
32+
Please don't read these assumptions as saying that IOTstack will not run on other hardware, other operating systems, or as a different user. It is just that IOTstack gets most of its testing under these conditions. The further you get from these implicit assumptions, the more your mileage may vary.
33+
34+
### <a name="otherPlatforms"> other platforms </a>
35+
36+
Users have reported success on other platforms, including:
37+
38+
* [Orange Pi WinPlus](https://github.com/SensorsIot/IOTstack/issues/375)
3339

3440
## <a name="newInstallation"> new installation </a>
3541

@@ -120,7 +126,7 @@ If you are still running on gcgarner/IOTstack and need to migrate to SensorsIot/
120126
Run the following commands:
121127

122128
```
123-
$ sudo bash -c '[ $(egrep -c "^allowinterfaces eth0,wlan0" /etc/dhcpcd.conf) -eq 0 ] && echo "allowinterfaces eth0,wlan0" >> /etc/dhcpcd.conf'
129+
$ sudo bash -c '[ $(egrep -c "^allowinterfaces eth*,wlan*" /etc/dhcpcd.conf) -eq 0 ] && echo "allowinterfaces eth*,wlan*" >> /etc/dhcpcd.conf'
124130
$ sudo reboot
125131
```
126132

@@ -131,7 +137,7 @@ See [Issue 219](https://github.com/SensorsIot/IOTstack/issues/219) and [Issue 25
131137
If you don't have this patch in place, Docker images that are based on Alpine will fail if an image's maintainer updates to [Alpine 3.13](https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0#time64_requirement).
132138

133139
```
134-
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
140+
$ sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
135141
$ echo "deb http://httpredir.debian.org/debian buster-backports main contrib non-free" | sudo tee -a "/etc/apt/sources.list.d/debian-backports.list"
136142
$ sudo apt update
137143
$ sudo apt install libseccomp2 -t buster-backports
@@ -375,7 +381,7 @@ You can also turn logging off or set it to use another option for any service by
375381

376382
### <a name="upContainer"> starting an individual container </a>
377383

378-
To start the stack:
384+
To start a particular container:
379385

380386
```
381387
$ cd ~/IOTstack
@@ -566,7 +572,7 @@ $ sudo mkdir -p ./volumes/influxdb/data
566572

567573
When InfluxDB starts, it sees that the folder on right-hand-side of the volumes mapping (`/var/lib/influxdb`) is empty and initialises new databases.
568574

569-
This is how **most** containers behave. But there are exceptions. A good example of an exception is Mosquitto which does not re-initialise correctly so you should avoid removing its persistent store.
575+
This is how **most** containers behave. There are exceptions so it's always a good idea to keep a backup.
570576

571577
## <a name="stackMaintenance"> stack maintenance </a>
572578

@@ -673,6 +679,7 @@ $ cd ~/IOTstack
673679
$ docker-compose build --no-cache --pull «container»
674680
$ docker-compose up -d «container»
675681
$ docker system prune
682+
$ docker system prune
676683
```
677684

678685
This causes DockerHub to be checked for the later version of the *base* image, downloading it as needed.
@@ -687,7 +694,7 @@ As your system evolves and new images come down from DockerHub, you may find tha
687694
$ docker system prune
688695
```
689696

690-
This recovers anything no longer in use.
697+
This recovers anything no longer in use. Sometimes multiple `prune` commands are needed (eg the first removes an old *local* image, the second removes the old *base* image).
691698

692699
If you add a container via `menu.sh` and later remove it (either manually or via `menu.sh`), the associated images(s) will probably persist. You can check which images are installed via:
693700

@@ -713,6 +720,64 @@ $ docker rmi dbf28ba50432
713720

714721
In general, you can use the repository name to remove an image but the Image ID is sometimes needed. The most common situation where you are likely to need the Image ID is after an image has been updated on DockerHub and pulled down to your Raspberry Pi. You will find two containers with the same name. One will be tagged "latest" (the running version) while the other will be tagged "\<none\>" (the prior version). You use the Image ID to resolve the ambiguity.
715722

723+
### <a name="versionPinning"> pinning to specific versions </a>
724+
725+
See [container image updates](#imageUpdates) to understand how to tell the difference between images that are used "as is" from DockerHub versus those that are built from local Dockerfiles.
726+
727+
Note:
728+
729+
* You should **always** visit an image's DockerHub page before pinning to a specific version. This is the only way to be certain that you are choosing the appropriate version suffix.
730+
731+
To pin an image to a specific version:
732+
733+
* If the image comes straight from DockerHub, you apply the pin in `docker-compose.yml`. For example, to pin Grafana to version 7.5.7, you change:
734+
735+
```
736+
grafana:
737+
container_name: grafana
738+
image: grafana/grafana:latest
739+
740+
```
741+
742+
to:
743+
744+
```
745+
grafana:
746+
container_name: grafana
747+
image: grafana/grafana:7.5.7
748+
749+
```
750+
751+
To apply the change, "up" the container:
752+
753+
```
754+
$ cd ~/IOTstack
755+
$ docker-compose up -d grafana
756+
```
757+
758+
* If the image is built using a local Dockerfile, you apply the pin in the Dockerfile. For example, to pin Mosquitto to version 1.6.15, edit `~/IOTstack/.templates/mosquitto/Dockerfile` to change:
759+
760+
```
761+
# Download base image
762+
FROM eclipse-mosquitto:latest
763+
764+
```
765+
766+
to:
767+
768+
```
769+
# Download base image
770+
FROM eclipse-mosquitto:1.6.15
771+
772+
```
773+
774+
To apply the change, "up" the container and pass the `--build` flag:
775+
776+
```
777+
$ cd ~/IOTstack
778+
$ docker-compose up -d --build mosquitto
779+
```
780+
716781
## <a name="nuclearOption"> the nuclear option - use with caution </a>
717782

718783
You can use Git to delete all files and folders to return your folder to the freshly cloned state.

0 commit comments

Comments
 (0)