Move dependency installation to Dockerfile
Moved installation of speedtest commandline utility to Dockerfile. Did not remove the (optional, if no cmdline utility found) installation from entrypoint, so that the program can be run from entrypoint without using docker as a fall-back.
This commit is contained in:
parent
c214c9aed0
commit
0d868c05fe
2 changed files with 17 additions and 12 deletions
10
Dockerfile
10
Dockerfile
|
@ -1,6 +1,6 @@
|
||||||
FROM python:3.8-slim-buster
|
FROM python:3.8-slim-buster
|
||||||
LABEL maintainer="Breadlysm" \
|
LABEL maintainer="Marty Oehme" \
|
||||||
description="Original by Aiden Gilmartin. Maintained by Breadlysm"
|
description="Original by Aiden Gilmartin & Breadlysm."
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
@ -10,6 +10,12 @@ RUN true &&\
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get -q -y install --no-install-recommends apt-utils gnupg1 apt-transport-https dirmngr && \
|
apt-get -q -y install --no-install-recommends apt-utils gnupg1 apt-transport-https dirmngr && \
|
||||||
\
|
\
|
||||||
|
# Add repos
|
||||||
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61 && \
|
||||||
|
echo "deb https://ookla.bintray.com/debian buster main" > /etc/apt/sources.list.d/speedtest.list && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get -q -y install --no-install-recommends speedtest && \
|
||||||
|
\
|
||||||
# Install Python packages
|
# Install Python packages
|
||||||
pip3 install pythonping influxdb-client && \
|
pip3 install pythonping influxdb-client && \
|
||||||
\
|
\
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
printenv >> /etc/environment
|
printenv >>/etc/environment
|
||||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" >/etc/timezone
|
||||||
|
|
||||||
# Install speedtest-cli
|
# Install speedtest-cli
|
||||||
if [ ! -e /usr/bin/speedtest ]
|
if [ ! -e /usr/bin/speedtest ]; then
|
||||||
then
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61
|
||||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61
|
echo "deb https://ookla.bintray.com/debian buster main" | tee /etc/apt/sources.list.d/speedtest.list
|
||||||
echo "deb https://ookla.bintray.com/debian buster main" | tee /etc/apt/sources.list.d/speedtest.list
|
apt-get update && apt-get -q -y install speedtest
|
||||||
apt-get update && apt-get -q -y install speedtest
|
apt-get -q -y autoremove && apt-get -q -y clean
|
||||||
apt-get -q -y autoremove && apt-get -q -y clean
|
rm -rf /var/lib/apt/lists/*
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /usr/local/bin/python3 $@
|
exec /usr/local/bin/python3 "$@"
|
||||||
|
|
Loading…
Reference in a new issue