Skip to content

Commit

Permalink
clean dockerfile, remove unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tob1as committed Feb 26, 2021
1 parent a2dca1b commit 6dcf153
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
14 changes: 10 additions & 4 deletions alpine.armhf.python.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ LABEL org.opencontainers.image.authors="Tobias Hargesheimer <docker@ison.ws>" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/rpi-sensors/" \
org.opencontainers.image.source="https://github.com/Tob1as/rpi-sensors"

SHELL ["/bin/sh", "-euxo", "pipefail", "-c"]

COPY dht_sensor.py /

RUN set -ex; \
apk add --no-cache \
RUN \
apk add --no-cache --virtual .build-deps \
gcc libc-dev \
libgpiod \
mariadb-connector-c-dev \
; \
apk add --no-cache \
libgpiod \
mariadb-connector-c \
; \
pip3 install --no-cache-dir rpi.gpio; \
pip3 install --no-cache-dir adafruit-circuitpython-dht==3.5.5; \
pip3 install --no-cache-dir mariadb; \
pip3 install --no-cache-dir adafruit-circuitpython-dht==3.5.5; \
apk del --no-network --purge .build-deps; \
chmod +x /dht_sensor.py

CMD ["python3", "-u", "./dht_sensor.py"]
13 changes: 7 additions & 6 deletions debian.armhf.python.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ LABEL org.opencontainers.image.authors="Tobias Hargesheimer <docker@ison.ws>" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/rpi-sensors/" \
org.opencontainers.image.source="https://github.com/Tob1as/rpi-sensors"

SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]

COPY dht_sensor.py /

RUN set -ex; \
apt-get update; \
BUILD_PACKAGES='gcc libc6-dev libmariadb-dev'; \
apt-get install -y --no-install-recommends \
#build-essential \
#python3-dev \
#python3-openssl \
gcc libc6-dev \
$BUILD_PACKAGES \
libgpiod2 \
libmariadb-dev \
libmariadb3 \
; \
rm -rf /var/lib/apt/lists/*; \
pip3 install --no-cache-dir rpi.gpio; \
pip3 install --no-cache-dir adafruit-circuitpython-dht==3.5.5; \
pip3 install --no-cache-dir mariadb; \
pip3 install --no-cache-dir adafruit-circuitpython-dht==3.5.5; \
apt-get remove --purge -y $BUILD_PACKAGES; apt autoremove -y ; \
chmod +x /dht_sensor.py

CMD ["python3", "-u", "./dht_sensor.py"]

0 comments on commit 6dcf153

Please sign in to comment.