diff --git a/Dockerfile b/Dockerfile index 6c3d0b3..d951dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy as builder +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy as builder # Must be linux/amd64 or linux/arm64 ARG TARGETARCH @@ -8,12 +8,12 @@ COPY mysql-data-mover.sln . ENV SOLUTION_NAME "./mysql-data-mover.sln" -RUN dotnet restore ${SOLUTION_NAME} --arch ${TARGETARCH} --packages /packages/${TARGETARCH} -RUN dotnet build --no-restore --source /packages/${TARGETARCH} --configuration Release ${SOLUTION_NAME} +RUN dotnet restore ${SOLUTION_NAME} +RUN dotnet build --no-restore --configuration Release ${SOLUTION_NAME} RUN dotnet test --no-restore --configuration Release ${SOLUTION_NAME} -RUN dotnet publish --no-restore --source /packages/${TARGETARCH} --configuration Release --property:PublishDir=/output/${TARGETARCH} ${SOLUTION_NAME} +RUN dotnet publish --no-restore --configuration Release --property:PublishDir=/output/${TARGETARCH} ${SOLUTION_NAME} -FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled # Must be linux/amd64 or linux/arm64 ARG TARGETARCH