File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 33# (errors common in arm/v7 32bit) https://github.com/dotnet/dotnet-docker/issues/1537
44# https://hub.docker.com/_/microsoft-dotnet
55# hadolint ignore=DL3029
6+ # to build for a different platform than your host, use --platform=<platform>
7+ # for example, if you were on Intel (amd64) and wanted to build for ARM, you would use:
8+ # docker buildx build --platform "linux/arm64/v8" .
69FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:7.0 as build
710ARG TARGETPLATFORM
811ARG BUILDPLATFORM
@@ -13,6 +16,7 @@ COPY *.csproj .
1316RUN case ${TARGETPLATFORM} in \
1417 "linux/amd64" ) ARCH=x64 ;; \
1518 "linux/arm64" ) ARCH=arm64 ;; \
19+ "linux/arm64/v8" ) ARCH=arm64 ;; \
1620 "linux/arm/v7" ) ARCH=arm ;; \
1721 esac \
1822 && dotnet restore -r linux-${ARCH}
@@ -21,6 +25,7 @@ COPY . .
2125RUN case ${TARGETPLATFORM} in \
2226 "linux/amd64" ) ARCH=x64 ;; \
2327 "linux/arm64" ) ARCH=arm64 ;; \
28+ "linux/arm64/v8" ) ARCH=arm64 ;; \
2429 "linux/arm/v7" ) ARCH=arm ;; \
2530 esac \
2631 && dotnet publish -c release -o /app -r linux-${ARCH} --self-contained false --no-restore
You can’t perform that action at this time.
0 commit comments