diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bf2bc965..bf0110c8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,7 +12,13 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v2 - + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: @@ -37,6 +43,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v4 with: + platforms: linux/arm64,linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -44,6 +51,7 @@ jobs: - name: Build and push Docker image slim version uses: docker/build-push-action@v4 with: + platforms: linux/arm64,linux/amd64 file: ./DockerfileSlim push: true tags: ${{ steps.meta_slim.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 5eebebbf..7257ddc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,9 @@ ENV ARCHIVE_FILE "" RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ && apk --no-cache add python3-dev libffi-dev gcc libc-dev py3-pip py3-cffi py3-cryptography ca-certificates bash +# https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 +RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED + WORKDIR /opt/grafana-backup-tool ADD . /opt/grafana-backup-tool diff --git a/DockerfileSlim b/DockerfileSlim index acd4b028..00c7af86 100644 --- a/DockerfileSlim +++ b/DockerfileSlim @@ -32,6 +32,8 @@ RUN chmod -R a+r /opt/grafana-backup-tool \ RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ && apk add --no-cache --virtual build-deps ${DEV_PACKAGES} \ && apk add --no-cache ${PACKAGES} \ + # https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 + && rm /usr/lib/python3.11/EXTERNALLY-MANAGED \ && pip3 --no-cache-dir install . \ && chown -R ${UID}:${GID} /opt/grafana-backup-tool \ && apk del build-deps