Update toogoodtogo-ha-mqtt-bridge to prebuild images

This commit is contained in:
Max Winterstein
2021-02-10 20:40:16 +01:00
parent dfd8a27be1
commit f1d103a25e
7 changed files with 74 additions and 30 deletions

View File

@@ -1,3 +1,23 @@
# sneaky trick to get around the requirement of {arch}-variabe based docker repositories
ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:6.0.0
FROM ${BUILD_FROM}
FROM maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge:1.3.0
# Add poetry # TODO: Get rid of the overhead
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH=$HOME/.poetry/bin/:${PATH}
RUN poetry config virtualenvs.create false
# Calls for a random number to bust the cache
# (https://stackoverflow.com/questions/35134713/disable-cache-for-specific-run-commands/58801213#58801213)
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
# add source and unpack
ADD "https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge/archive/v1.3.0.tar.gz" /src.tar.gz
RUN mkdir /app && tar xvfz /src.tar.gz -C /app --strip-components=1
# install
WORKDIR /app
RUN poetry install --no-dev
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]