kiwix: add initial docker image

This commit is contained in:
Starbeamrainbowlabs 2022-11-05 22:10:19 +00:00
parent d94ab2f0b4
commit 82eda1e062
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 42 additions and 0 deletions

28
images/kiwix/Dockerfile Normal file
View file

@ -0,0 +1,28 @@
ARG REPO_LOCATION
FROM ${REPO_LOCATION}minideb AS builder
RUN install_packages software-properties-common curl ca-certificates tar gzip
RUN curl -Lo /tmp/kiwix-tools_linux-armhf.tar.gz https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-armhf.tar.gz \
&& mkdir /app \
&& tar --strip-components=1 -xf /tmp/kiwix-tools_linux-armhf.tar.gz -C /app \
&& rm /tmp/kiwix-tools_linux-armhf.tar.gz
FROM ${REPO_LOCATION}minideb
COPY --from=builder /app /app
WORKDIR /app
COPY ./run.sh /srv/run.sh
VOLUME /srv/data
WORKDIR /app
USER 10600:10600
ENTRYPOINT [ "/srv/run.sh" ]
CMD [ "serve" ]

13
images/kiwix/run.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
echo ">>> Environment:"
echo "[wrapper] NOMAD_PORT_KIWIX=$NOMAD_PORT_KIWIX"
echo "[wrapper] Args: $*"
echo ">>> Checking environment"
if [[ -z "${NOMAD_PORT_KIWIX}" ]]; then
echo "Error: The environment variable NOMAD_PORT_KIWIX is not set. It must be set to the port number to listen on." >&2;
fi
echo ">>> Starting kiwix";
/app/kiwix-serve --library --port "${NOMAD_PORT_KIWIX}" /srv/data;

1
images/kiwix/type.txt Normal file
View file

@ -0,0 +1 @@
docker