Skip to content

Commit

Permalink
multi arch
Browse files Browse the repository at this point in the history
  • Loading branch information
cherchyk committed Feb 12, 2024
1 parent 979f376 commit 3292e93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/image-build-push-arm64.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/image-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ jobs:
platforms: linux/amd64,linux/arm64
file: ./Service.Dockerfile
tags: ${{ secrets.DOCKERHUB_USERNAME }}/service:latest
# build-args: |
# BUILD_IMAGE_TAG=8.0-jammy-arm64v8
# RUN_IMAGE_TAG=8.0-alpine-arm64v8
9 changes: 7 additions & 2 deletions Service.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ ARG RUN_IMAGE_TAG="7.0-alpine"
# build and publish
#########################################################################

FROM mcr.microsoft.com/dotnet/sdk:$BUILD_IMAGE_TAG AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:$BUILD_IMAGE_TAG AS build
ARG BUILD_CONFIGURATION=Release

ARG TARGETARCH
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log

WORKDIR /src
COPY ["service/Service/Service.csproj", "service/Service/"]
RUN dotnet restore "./service/Service/./Service.csproj"
Expand All @@ -27,7 +32,7 @@ RUN dotnet publish "./Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p
# run
#########################################################################

FROM mcr.microsoft.com/dotnet/aspnet:$RUN_IMAGE_TAG AS base
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:$RUN_IMAGE_TAG AS base
# Non-root user that will run the service
ARG USER=km
RUN \
Expand Down

0 comments on commit 3292e93

Please sign in to comment.