Browse Source

docker: no longer require build arg SWITCHBOT_MQTT_VERSION

Fabian Peter Hammerle 3 years ago
parent
commit
046e59cda6
3 changed files with 8 additions and 2 deletions
  1. 2 0
      .dockerignore
  2. 2 0
      CHANGELOG.md
  3. 4 2
      Dockerfile

+ 2 - 0
.dockerignore

@@ -1,4 +1,6 @@
 *
+# setuptools_scm
+!.git/
 !COPYING
 !Pipfile
 !Pipfile.lock

+ 2 - 0
CHANGELOG.md

@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [Unreleased]
 ### Fixed
 - Fixed executable name in command line help
+- Docker: no longer require build arg `SWITCHBOT_MQTT_VERSION`
+  (fixes auto build on hub.docker.com)
 
 ## [0.1.0] - 2020-05-08
 ### Added

+ 4 - 2
Dockerfile

@@ -13,6 +13,8 @@ RUN apk add --no-cache \
     make \
     musl-dev \
     py3-virtualenv
+# TODO merge
+RUN apk add --no-cache git `# setuptools_scm`
 
 ARG SOURCE_DIR_PATH
 RUN mkdir $SOURCE_DIR_PATH \
@@ -25,8 +27,8 @@ ENV PATH=$VIRTUALENV_PATH/bin:$PATH
 WORKDIR $SOURCE_DIR_PATH
 RUN pip install --no-cache-dir pipenv
 COPY --chown=nobody . $SOURCE_DIR_PATH
-ARG SWITCHBOT_MQTT_VERSION=
-RUN SETUPTOOLS_SCM_PRETEND_VERSION=$SWITCHBOT_MQTT_VERSION pipenv install --deploy --verbose
+RUN pipenv install --deploy --verbose \
+    && rm -r .git/
 
 # workaround for broken multi-stage copy
 # > failed to copy files: failed to copy directory: Error processing tar file(exit status 1): Container ID ... cannot be mapped to a host ID