diff --git a/Dockerfile b/Dockerfile index d9e5c64..d64c1b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ ARG SOURCE_DIR_PATH=/switchbot-mqtt FROM $BASE_IMAGE as build RUN apk add --no-cache \ + cargo `# cryptography build` \ gcc \ git `# setuptools_scm` \ glib-dev \ @@ -19,6 +20,8 @@ RUN apk add --no-cache \ py3-certifi `# pipenv` \ py3-pip `# pipenv install` \ py3-virtualenv `# pipenv` \ + python3-dev `# Python.h for cffi build` \ + rust `# cryptography build` \ && adduser -S build USER build @@ -33,9 +36,10 @@ ENV PIPENV_CACHE_DIR=/tmp/pipenv-cache \ # `sponge` is not pre-installed RUN jq 'del(.default."switchbot-mqtt", .default."sanitized-package")' Pipfile.lock > Pipfile.lock~ \ && mv Pipfile.lock~ Pipfile.lock \ - && pipenv install --deploy --verbose + && pipenv install --deploy COPY --chown=build:nobody . $SOURCE_DIR_PATH -RUN pipenv install --deploy --verbose \ +RUN if ! git status; then export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0; fi \ + && pipenv install --deploy \ && pipenv graph \ && pipenv run pip freeze \ && rm -rf .git/ $PIPENV_CACHE_DIR \