mosquitto: write initial Dockerfile

This commit is contained in:
Starbeamrainbowlabs 2021-04-10 16:04:52 +01:00
parent 909603b4a9
commit 58ce2bddf4
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 65 additions and 9 deletions

View file

@ -57,19 +57,20 @@ Please use the contact details on my website and _privately_ get in touch (don't
Image | Purpose Image | Purpose
--------------------|---------------- --------------------|----------------
`certbot` | Dockerised certbot via certbot-auto - currently doesn't build anymore because "certbot doesn't support your OS anymore" or something like that, but the version pushed to our private registry works just fine until we can rectify the issue `certbot` | Dockerised certbot via certbot-auto - currently doesn't build anymore because "certbot doesn't support your OS anymore" or something like that, but the version pushed to our private registry works just fine until we can rectify the issue
`docker-registry-ui`| [docker registry ui](https://github.com/Joxit/docker-registry-ui), dockerised `docker-registry-ui`| [docker registry ui](https://github.com/Joxit/docker-registry-ui), dockerised
`etherpad` | Dockerised [etherpad](https://etherpad.org/) (currently faulty, see [this GitHub issue](https://github.com/ether/etherpad-lite/issues/4962)) `etherpad` | Dockerised [etherpad](https://etherpad.org/) (currently faulty, see [this GitHub issue](https://github.com/ether/etherpad-lite/issues/4962))
`gossa` | Dockerised [gossa](https://github.com/pldubouilh/gossa/) `gossa` | Dockerised [gossa](https://github.com/pldubouilh/gossa/)
`jellyfin` | Dockerised [jellyfin](https://jellyfin.org/) `jellyfin` | Dockerised [jellyfin](https://jellyfin.org/)
`minetest` | Dockerised server for [minetest](https://github.com/minetest/minetest),, currently under construction `minetest` | Dockerised server for [minetest](https://github.com/minetest/minetest),, currently under construction
`minetest-mapserver`| Dockerised [minetest-mapserver](https://github.com/minetest-mapserver/mapserver) `minetest-mapserver`| Dockerised [minetest-mapserver](https://github.com/minetest-mapserver/mapserver)
`minideb` | Our main base image for (most) other images. Built from [minideb](https://github.com/bitnami/minideb), but customised to use our local apt-cacher-ng instance. `minideb` | Our main base image for (most) other images. Built from [minideb](https://github.com/bitnami/minideb), but customised to use our local apt-cacher-ng instance.
`minideb-node` | `minideb` with the latest Node.js installed via our [apt repository](https://apt.starbeamrainbowlabs.com/) `minideb-node` | `minideb` with the latest Node.js installed via our [apt repository](https://apt.starbeamrainbowlabs.com/)
`node-serve` | `minideb-node` with [serve](https://www.npmjs.com/package/serve) installed & set as the entrypoint `mosquitto` | Dockerised Mosquitto MQTT server
`paperless-ng` | Dockerised [paperless-ng](https://github.com/jonaswinkler/paperless-ng) - currently under construction `node-serve` | `minideb-node` with [serve](https://www.npmjs.com/package/serve) installed & set as the entrypoint
`redis` | Dockerised [redis](https://redis.io/), installs the latest stable version `paperless-ng` | Dockerised [paperless-ng](https://github.com/jonaswinkler/paperless-ng) - currently under construction
`shiori` | Dockerised [shiori](https://github.com/go-shiori/shiori), built from source `redis` | Dockerised [redis](https://redis.io/), installs the latest stable version
`shiori` | Dockerised [shiori](https://github.com/go-shiori/shiori), built from source
## Docker container UID/GID map ## Docker container UID/GID map
@ -79,8 +80,9 @@ UID | GID | Container | Notes
60 | 60 | minetest-mapserver | 60 | 60 | minetest-mapserver |
70 | 70 | etherpad | 70 | 70 | etherpad |
80 | 80 | serve | Static HTTP Server based on Node.js 80 | 80 | serve | Static HTTP Server based on Node.js
85 | 85 | mosquitto |
90 | 90 | jellyfin | 90 | 90 | jellyfin |
95 | 95 | shiorio | Shiori bookmark system, built from source 95 | 95 | shiori | Shiori bookmark system, built from source
999 | 994 | certbot | The same user & group as fabio, because file permissions 999 | 994 | certbot | The same user & group as fabio, because file permissions
2100 | 2100 | redis | 2100 | 2100 | redis |

View file

@ -0,0 +1,13 @@
ARG REPO_LOCATION
FROM ${REPO_LOCATION}minideb
RUN install_packages mosquitto
COPY ./run.sh /usr/local/bin/run.sh
USER 85:85
VOLUME /srv
ENTRYPOINT [ "/usr/local/bin/run.sh"
CMD [ "start" ]

40
images/mosquitto/run.sh Executable file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env bash
action="${1}";
show_help() {
echo "Usage:" >&2;
echo " run.sh <start|reload>" >&2;
}
log_msg() {
echo "[ ${SECONDS} ] >>> mosquitto:run.sh: $*" >&2;
}
if [[ -z "${action}" ]]; then
show_help;
return 0;
fi
log_msg "Running ${action} action";
case "${action}" in
start )
log_msg "Starting mosquitto";
if [[ ! -e "/srv/mosquitto.conf" ]]; then
log_msg "Warning: No configuration file found at /srv/mosquitto.conf";
fi
exec mosquitto --config-file /srv/mosquitto.conf;
;;
reload )
pid="$(pgrep mosquitto)";
log_msg "Reloading by sending SIGHUP to PID ${pid}";
kill -s HUP "${pid}";
;;
* )
show_help;
;;
esac

View file

@ -0,0 +1 @@
docker