0.1.1 based on python 3.8-slim

This commit is contained in:
lolouk44 2020-05-27 23:12:33 +01:00
parent be40e47f49
commit 85e36472f6

View file

@ -1,38 +1,18 @@
FROM python:3.8-alpine FROM python:3.8-slim
WORKDIR /opt/miscale WORKDIR /opt/miscale
COPY src /opt/miscale COPY src /opt/miscale
RUN apk update && \ RUN apt-get update && apt-get install -y \
apk add --no-cache \ bluez \
dcron \ python-pip \
bash \ libglib2.0-dev && \
bash-doc \ rm -rf /var/lib/apt/lists/*
bash-completion \
tar \
linux-headers \
gcc \
make \
glib-dev \
alpine-sdk \
&& rm -rf /var/cache/apk/*
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
# RUN mkdir -p /var/log/cron \ # Copy in docker scripts to root of container...
# && mkdir -m 0644 -p /var/spool/cron/crontabs \
# && touch /var/log/cron/cron.log \
# && mkdir -m 0644 -p /etc/cron.d && \
# echo -e "@reboot python3 /opt/miscale/Xiaomi_Scale.py\n" >> /var/spool/cron/crontabs/root
## Cleanup
RUN apk del alpine-sdk gcc make tar
# Copy in docker scripts to root of container... (cron won't run unless it's run under bash/ash shell)
COPY dockerscripts/ / COPY dockerscripts/ /
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["/cmd.sh"] CMD ["/cmd.sh"]
# To test, run with the following:
# docker run --rm -it --privileged --net=host -e MISCALE_MAC=0C:95:41:C9:46:43 -e MQTT_HOST=10.16.10.4 mi-scale_mi-scale