Skip to content

Commit

Permalink
Merge pull request #253 from AngellusMortis/docker-arm
Browse files Browse the repository at this point in the history
Build multi-platform images
  • Loading branch information
christophetd authored Jul 4, 2023
2 parents c2b5536 + d589868 commit 3316149
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
push: true
build-args: |
VERSION=${{ github.ref_name }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ jobs:
permissions:
contents: read
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
push: false
build-args: |
VERSION=${{ github.ref_name }}
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM python:3.10-alpine3.17 AS base
FROM python:3.10-slim-bullseye AS base
LABEL org.opencontainers.image.source="https://github.com/DataDog/guarddog/"

RUN --mount=type=cache,mode=0755,id=apk,target=/var/cache/apk \
apk add --update libgit2 libffi
RUN addgroup --system --gid 1000 app \
&& adduser --system --shell /bin/bash --uid 1000 --ingroup app app

Expand All @@ -14,8 +12,6 @@ FROM base as builder
# only copy source for build
COPY . /app
# install any build time deps + Python deps
RUN --mount=type=cache,mode=0755,id=apk,target=/var/cache/apk \
apk add --update gcc musl-dev g++ libgit2-dev libffi-dev
RUN --mount=type=cache,mode=0755,id=pip,target=/root/.cache/pip \
# install python deps
pip install --root-user-action=ignore -r requirements.txt \
Expand Down

0 comments on commit 3316149

Please sign in to comment.