File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 88# docker buildx build --platform "linux/arm64/v8" .
99FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:7.0 as build
1010ARG TARGETPLATFORM
11+ ARG TARGETARCH
1112ARG BUILDPLATFORM
1213RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
1314
1415WORKDIR /source
1516COPY *.csproj .
16- RUN case ${TARGETPLATFORM} in \
17- "linux/amd64" ) ARCH=x64 ;; \
18- "linux/arm64" ) ARCH=arm64 ;; \
19- "linux/arm64/v8" ) ARCH=arm64 ;; \
20- "linux/arm/v7" ) ARCH=arm ;; \
21- esac \
22- && dotnet restore -r linux-${ARCH}
17+ RUN dotnet restore -a $TARGETARCH
2318
2419COPY . .
25- RUN case ${TARGETPLATFORM} in \
26- "linux/amd64" ) ARCH=x64 ;; \
27- "linux/arm64" ) ARCH=arm64 ;; \
28- "linux/arm64/v8" ) ARCH=arm64 ;; \
29- "linux/arm/v7" ) ARCH=arm ;; \
30- esac \
31- && dotnet publish -c release -o /app -r linux-${ARCH} --self-contained false --no-restore
20+ RUN dotnet publish -c release -o /app -a $TARGETARCH --self-contained false --no-restore
3221
3322# app image
3423FROM mcr.microsoft.com/dotnet/runtime:7.0
You can’t perform that action at this time.
0 commit comments