From 804adb8b69167d5eb40d5ba974e09a65dfad2fbd Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 11 Nov 2024 17:49:58 +0900 Subject: [PATCH 1/4] ci: use setup-qemu-action instead --- .github/workflows/push_docker_image.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index 238840de9..17d5ed226 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -43,11 +43,8 @@ jobs: docker login \ --username '${{ secrets.DOCKER_USERNAME }}' \ --password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}' - - name: setup-qemu - run: | - docker run --rm --privileged multiarch/qemu-user-static \ - --reset \ - -p yes + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: From ef8afc502da080162914f6a55517749671e0bf37 Mon Sep 17 00:00:00 2001 From: moreal Date: Tue, 12 Nov 2024 07:15:01 +0900 Subject: [PATCH 2/4] ci: show docker build logs as plain mode --- .github/workflows/push_docker_image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index 17d5ed226..6d213dc1d 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -57,6 +57,8 @@ jobs: tags: ${{ matrix.docker.repo }}:git-${{ github.sha }} file: ${{ matrix.docker.dockerfile }} build-args: COMMIT=git-${{ github.sha }} + env: + BUILDKIT_PROGRESS: 'plain' tag: name: tag (${{ matrix.docker.repo }}) From d7ada47ca31bf55ba3554ff335dbbe950972ec3f Mon Sep 17 00:00:00 2001 From: moreal Date: Tue, 12 Nov 2024 07:34:37 +0900 Subject: [PATCH 3/4] chore: make base image same with the previous --- Dockerfile | 2 +- Dockerfile.ACC | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e636ecdc3..4a5088965 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ fi EOF # Build runtime image -FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim WORKDIR /app COPY --from=build-env /app/out . diff --git a/Dockerfile.ACC b/Dockerfile.ACC index 7098fa415..af6144b76 100644 --- a/Dockerfile.ACC +++ b/Dockerfile.ACC @@ -32,7 +32,7 @@ fi EOF # Build runtime image -FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim WORKDIR /app RUN apt-get update && apt-get install -y libc6-dev COPY --from=build-env /app/out . From 701d6c6a192677ae9ca237d920194daedb0e4730 Mon Sep 17 00:00:00 2001 From: moreal Date: Tue, 12 Nov 2024 07:51:01 +0900 Subject: [PATCH 4/4] chore: make docker build .NET natively instead emulation --- Dockerfile | 2 +- Dockerfile.ACC | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a5088965..0626f3b60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT ARG TARGETPLATFORM diff --git a/Dockerfile.ACC b/Dockerfile.ACC index af6144b76..8e9f84ccf 100644 --- a/Dockerfile.ACC +++ b/Dockerfile.ACC @@ -1,5 +1,5 @@ # Use the SDK image to build the app -FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app ARG COMMIT ARG TARGETPLATFORM