Skip to content

Commit

Permalink
Merge pull request #41 from unixorn/bugfix-docker-build
Browse files Browse the repository at this point in the history
Bugfix docker build
  • Loading branch information
unixorn authored Feb 23, 2023
2 parents a3bb1e8 + 33892e5 commit d3b19c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ RUN apt-get update && \
# Copy wheel file built by Poetry
COPY dist/*.whl /app/

RUN /usr/bin/python3 -m pip install --upgrade pip --no-cache-dir && \
pip3 install --no-cache-dir /app/*.whl && \
pip3 cache purge && \
RUN python -m pip install --upgrade pip --no-cache-dir && \
pip install --no-cache-dir /app/*.whl && \
pip cache purge && \
rm -rf /app/*.whl

USER nobody
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.PHONY: c clean \
f format \
h help \
fatimage \
local \
multiarch_image \
publish \
t test \
wheel
Expand Down Expand Up @@ -41,14 +41,14 @@ local: wheel requirements.txt ## Makes a docker image for only the architecture
trial: wheel
docker buildx build --no-cache --build-arg application_version=${MODULE_VERSION} --load -t unixorn/ha-mqtt-discoverable:$(MODULE_VERSION) .

fatimage: wheel ## Makes a multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
multiarch_image: wheel ## Makes a multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
docker buildx build --no-cache --build-arg application_version=${MODULE_VERSION} --platform linux/arm64,linux/amd64,linux/arm/v7 --push -t unixorn/ha-mqtt-discoverable:$(MODULE_VERSION) .
make local

wheel: clean format ## Builds a wheel for our modules. 'poetry' bakes the dependencies into the wheel metadata.
poetry build

publish: fatimage ## Builds a multi-architecture docker image and publishes the module to pypi
publish: multiarch_image ## Builds a multi-architecture docker image and publishes the module to pypi
poetry publish

# We use this to enable the Dockerfile.testing have a separate layer for the
Expand Down

0 comments on commit d3b19c2

Please sign in to comment.