Skip to content

Commit 632423a

Browse files
committed
Support for RPi 4
1 parent f3244e5 commit 632423a

File tree

11 files changed

+248
-148
lines changed

11 files changed

+248
-148
lines changed

mosquitto/arm/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM multiarch/alpine:armhf-v3.10
2+
3+
RUN addgroup -g 1000 mosquitto \
4+
&& echo 'mosquitto:x:1000:1000::/mosquitto:/sbin/nologin' >> /etc/passwd \
5+
&& apk --no-cache add mosquitto \
6+
&& mkdir -p /mosquitto/config /mosquitto/data /mosquitto/log \
7+
&& chown -R mosquitto:mosquitto /mosquitto \
8+
&& cp /etc/mosquitto/mosquitto.conf /mosquitto/config
9+
10+
VOLUME ["/mosquitto/config", "/mosquitto/data", "/mosquitto/log"]
11+
12+
USER mosquitto
13+
14+
#ENTRYPOINT ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]
15+
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]

mosquitto/arm/README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
https://github.com/eclipse/mosquitto
2+
3+
```
4+
docker run -d \
5+
--name=mosquitto \
6+
-p 1883:1883 \
7+
-p 9001:9001 \
8+
-v /storage/mosquitto/config:/mosquitto/config \
9+
-v /storage/mosquitto/data:/mosquitto/data \
10+
-v /storage/mosquitto/log:/mosquitto/log \
11+
--restart=always \
12+
zarusz/mosquitto:arm64
13+
```
14+
15+
/storage/mosquitto/config/mosquitto.conf
16+
```
17+
persistence true
18+
persistence_location /mosquitto/data/
19+
20+
log_dest file /mosquitto/log/mosquitto.log
21+
```
22+
23+
#Eclipse Mosquitto v1.4.10 Docker Image
24+
25+
##Mount Points
26+
27+
Three mount points have been created in the image to be used for configuration, persistent storage and logs.
28+
```
29+
/mosquitto/config
30+
/mosquitto/data
31+
/mosquitto/log
32+
```
33+
34+
35+
##Configuration
36+
37+
When running the image, the default configuration values are used.
38+
To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf`
39+
```
40+
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf mosquitto:1.4.10
41+
```
42+
43+
Configuration can be changed to:
44+
45+
* persist data to `/mosquitto/data`
46+
* log to `/mosquitto/log/mosquitto.log`
47+
48+
i.e. add the following to `mosquitto.conf`:
49+
```
50+
persistence true
51+
persistence_location /mosquitto/data/
52+
53+
log_dest file /mosquitto/log/mosquitto.log
54+
```
55+
56+
**Note**: If a volume is used, the data will persist between containers.
57+
58+
##Build
59+
Build the image:
60+
```
61+
docker build -t mosquitto:1.4.10 .
62+
```
63+
64+
##Run
65+
Run a container using the new image:
66+
```
67+
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log mosquitto:1.4.10
68+
```
69+
:boom: if the mosquitto configuration (mosquitto.conf) was modified
70+
to use non-default ports, the docker run command will need to be updated
71+
to expose the ports that have been configured.

mosquitto/arm/build_image.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker build . -t zarusz/mosquitto:v1.0.0-armhf

mosquitto/arm/push_image.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker push zarusz/mosquitto:v1.0.0-armhf

mosquitto/arm64/Dockerfile

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
FROM multiarch/alpine:aarch64-v3.6
2-
3-
RUN addgroup -g 1000 mosquitto \
4-
&& echo 'mosquitto:x:1000:1000::/mosquitto:/sbin/nologin' >> /etc/passwd \
5-
&& apk --no-cache add mosquitto \
6-
&& mkdir -p /mosquitto/config /mosquitto/data /mosquitto/log \
7-
&& chown -R mosquitto:mosquitto /mosquitto \
8-
&& cp /etc/mosquitto/mosquitto.conf /mosquitto/config
9-
10-
VOLUME ["/mosquitto/config", "/mosquitto/data", "/mosquitto/log"]
11-
12-
USER mosquitto
13-
14-
#ENTRYPOINT ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]
15-
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]
1+
FROM multiarch/alpine:aarch64-v3.6
2+
3+
RUN addgroup -g 1000 mosquitto \
4+
&& echo 'mosquitto:x:1000:1000::/mosquitto:/sbin/nologin' >> /etc/passwd \
5+
&& apk --no-cache add mosquitto \
6+
&& mkdir -p /mosquitto/config /mosquitto/data /mosquitto/log \
7+
&& chown -R mosquitto:mosquitto /mosquitto \
8+
&& cp /etc/mosquitto/mosquitto.conf /mosquitto/config
9+
10+
VOLUME ["/mosquitto/config", "/mosquitto/data", "/mosquitto/log"]
11+
12+
USER mosquitto
13+
14+
#ENTRYPOINT ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]
15+
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]

mosquitto/arm64/README.md

+71-71
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
https://github.com/eclipse/mosquitto
2-
3-
```
4-
docker run -d \
5-
--name=mosquitto \
6-
-p 1883:1883 \
7-
-p 9001:9001 \
8-
-v /storage/mosquitto/config:/mosquitto/config \
9-
-v /storage/mosquitto/data:/mosquitto/data \
10-
-v /storage/mosquitto/log:/mosquitto/log \
11-
--restart=always \
12-
zarusz/mosquitto:arm64
13-
```
14-
15-
/storage/mosquitto/config/mosquitto.conf
16-
```
17-
persistence true
18-
persistence_location /mosquitto/data/
19-
20-
log_dest file /mosquitto/log/mosquitto.log
21-
```
22-
23-
#Eclipse Mosquitto v1.4.10 Docker Image
24-
25-
##Mount Points
26-
27-
Three mount points have been created in the image to be used for configuration, persistent storage and logs.
28-
```
29-
/mosquitto/config
30-
/mosquitto/data
31-
/mosquitto/log
32-
```
33-
34-
35-
##Configuration
36-
37-
When running the image, the default configuration values are used.
38-
To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf`
39-
```
40-
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf mosquitto:1.4.10
41-
```
42-
43-
Configuration can be changed to:
44-
45-
* persist data to `/mosquitto/data`
46-
* log to `/mosquitto/log/mosquitto.log`
47-
48-
i.e. add the following to `mosquitto.conf`:
49-
```
50-
persistence true
51-
persistence_location /mosquitto/data/
52-
53-
log_dest file /mosquitto/log/mosquitto.log
54-
```
55-
56-
**Note**: If a volume is used, the data will persist between containers.
57-
58-
##Build
59-
Build the image:
60-
```
61-
docker build -t mosquitto:1.4.10 .
62-
```
63-
64-
##Run
65-
Run a container using the new image:
66-
```
67-
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log mosquitto:1.4.10
68-
```
69-
:boom: if the mosquitto configuration (mosquitto.conf) was modified
70-
to use non-default ports, the docker run command will need to be updated
71-
to expose the ports that have been configured.
1+
https://github.com/eclipse/mosquitto
2+
3+
```
4+
docker run -d \
5+
--name=mosquitto \
6+
-p 1883:1883 \
7+
-p 9001:9001 \
8+
-v /storage/mosquitto/config:/mosquitto/config \
9+
-v /storage/mosquitto/data:/mosquitto/data \
10+
-v /storage/mosquitto/log:/mosquitto/log \
11+
--restart=always \
12+
zarusz/mosquitto:arm64
13+
```
14+
15+
/storage/mosquitto/config/mosquitto.conf
16+
```
17+
persistence true
18+
persistence_location /mosquitto/data/
19+
20+
log_dest file /mosquitto/log/mosquitto.log
21+
```
22+
23+
#Eclipse Mosquitto v1.4.10 Docker Image
24+
25+
##Mount Points
26+
27+
Three mount points have been created in the image to be used for configuration, persistent storage and logs.
28+
```
29+
/mosquitto/config
30+
/mosquitto/data
31+
/mosquitto/log
32+
```
33+
34+
35+
##Configuration
36+
37+
When running the image, the default configuration values are used.
38+
To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf`
39+
```
40+
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf mosquitto:1.4.10
41+
```
42+
43+
Configuration can be changed to:
44+
45+
* persist data to `/mosquitto/data`
46+
* log to `/mosquitto/log/mosquitto.log`
47+
48+
i.e. add the following to `mosquitto.conf`:
49+
```
50+
persistence true
51+
persistence_location /mosquitto/data/
52+
53+
log_dest file /mosquitto/log/mosquitto.log
54+
```
55+
56+
**Note**: If a volume is used, the data will persist between containers.
57+
58+
##Build
59+
Build the image:
60+
```
61+
docker build -t mosquitto:1.4.10 .
62+
```
63+
64+
##Run
65+
Run a container using the new image:
66+
```
67+
docker run -it -p 1883:1883 -p 9001:9001 -v <path-to-configuration-file>:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log mosquitto:1.4.10
68+
```
69+
:boom: if the mosquitto configuration (mosquitto.conf) was modified
70+
to use non-default ports, the docker run command will need to be updated
71+
to expose the ports that have been configured.

sdparm/README.md

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
## What
2-
3-
Enable power saving mode of the external USB HDD disk after 1.5 hours.
4-
5-
Useful for OS where you cannot install sdparm, but docker is available (LibreELEC).
6-
7-
## Usage
8-
9-
Power saving mode for disk `/dev/sda`:
10-
```
11-
docker run --rm --privileged --device=/dev/sda:/dev/sda -it zarusz/sdparm:arm64
12-
```
13-
14-
Power saving mode for disk by UUID:
15-
```
16-
docker run --rm --privileged --device=/dev/disk/by-uuid/FA59-8F03:/dev/sda -it zarusz/sdparm:arm64
17-
```
18-
19-
## sdparm
20-
21-
The container uses `sdparm` in this way:
22-
```
23-
sdparm --flexible -6 -l --save --set SCT=54000 --set STANDBY=1 /dev/sda
24-
```
25-
26-
1.5 hours is calculates from 54000 * 0.1s
27-
28-
The `--save` option will store the power management settings between machine restarts.
29-
30-
## Tweaking
31-
32-
Enter the container into shell:
33-
```
34-
docker run --rm --privileged --device=/dev/sda:/dev/sda -it zarusz/sdparm:arm64 /bin/sh
35-
```
36-
37-
Then play with the settings:
38-
39-
```
40-
sdparm --flexible -6 -l --set SCT=54000 /dev/sda
41-
sdparm --flexible -6 -l --set STANDBY=1 /dev/sda
42-
sdparm --flexible -6 -l --save --set SCT=54000 /dev/sda
43-
sdparm --flexible -6 -l --save --set STANDBY=1 /dev/sda
44-
45-
sdparm --flexible -6 -l --get SCT /dev/sda
46-
sdparm --flexible -6 -l --get STANDBY /dev/sda
47-
48-
sdparm --flexible -6 -l --save --set SCT=54000 --set STANDBY=1 /dev/sda
49-
sdparm --flexible -6 -l --set SCT=54000 --set STANDBY=1 /dev/sda
50-
```
51-
52-
More details see:
53-
https://lists.debian.org/debian-user/2015/08/msg00125.html
1+
## What
2+
3+
Enable power saving mode of the external USB HDD disk after 1.5 hours.
4+
5+
Useful for OS where you cannot install sdparm, but docker is available (LibreELEC).
6+
7+
## Usage
8+
9+
Power saving mode for disk `/dev/sda`:
10+
```
11+
docker run --rm --privileged --device=/dev/sda:/dev/sda -it zarusz/sdparm:arm64
12+
```
13+
14+
Power saving mode for disk by UUID:
15+
```
16+
docker run --rm --privileged --device=/dev/disk/by-uuid/FA59-8F03:/dev/sda -it zarusz/sdparm:arm64
17+
```
18+
19+
## sdparm
20+
21+
The container uses `sdparm` in this way:
22+
```
23+
sdparm --flexible -6 -l --save --set SCT=54000 --set STANDBY=1 /dev/sda
24+
```
25+
26+
1.5 hours is calculates from 54000 * 0.1s
27+
28+
The `--save` option will store the power management settings between machine restarts.
29+
30+
## Tweaking
31+
32+
Enter the container into shell:
33+
```
34+
docker run --rm --privileged --device=/dev/sda:/dev/sda -it zarusz/sdparm:arm64 /bin/sh
35+
```
36+
37+
Then play with the settings:
38+
39+
```
40+
sdparm --flexible -6 -l --save --set SCT=54000 --set STANDBY=1 /dev/sda
41+
sdparm --flexible -6 -l --set SCT=54000 --set STANDBY=1 /dev/sda
42+
43+
sdparm --flexible -6 -l --set SCT=54000 /dev/sdb
44+
sdparm --flexible -6 -l --set STANDBY=1 /dev/sdb
45+
sdparm --flexible -6 -l --save --set SCT=54000 /dev/sdb
46+
sdparm --flexible -6 -l --save --set STANDBY=1 /dev/sdb
47+
48+
sdparm --flexible -6 -l --get SCT /dev/sda
49+
sdparm --flexible -6 -l --get STANDBY /dev/sda
50+
```
51+
52+
More details see:
53+
https://lists.debian.org/debian-user/2015/08/msg00125.html

sdparm/arm64/Dockerfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM arm64v8/debian
2-
3-
RUN apt-get update \
4-
&& apt-get install sdparm -y
5-
6-
# Sleep after 1.5h = 54000 * 0.1s
7-
CMD ["/usr/bin/sdparm", "--flexible", "-6", "-l", "--save", "--set", "SCT=54000", "--set", "STANDBY=1", "/dev/sda"]
1+
FROM arm64v8/debian
2+
3+
RUN apt-get update \
4+
&& apt-get install sdparm -y
5+
6+
# Sleep after 1.5h = 54000 * 0.1s
7+
CMD ["/usr/bin/sdparm", "--flexible", "-6", "-l", "--save", "--set", "SCT=54000", "--set", "STANDBY=1", "/dev/sda"]

0 commit comments

Comments
 (0)