Finish up docker docs and fix docker non-buildx builds
This commit is contained in:
parent
108b19970b
commit
298f277bf0
2 changed files with 55 additions and 18 deletions
26
Dockerfile
26
Dockerfile
|
|
@ -1,3 +1,6 @@
|
|||
ARG TARGETPLATFORM=linux/amd64
|
||||
ARG BUILDPLATFORM=${TARGETPLATFORM}
|
||||
|
||||
FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:6.0 AS builder
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
|
@ -9,17 +12,18 @@ COPY . ./
|
|||
# Build and package release based on target architecture
|
||||
RUN dotnet build -v m
|
||||
WORKDIR /TShock/TShockLauncher
|
||||
RUN case "${TARGETPLATFORM}" in \
|
||||
"linux/amd64") export ARCH="linux-x64" \
|
||||
;; \
|
||||
"linux/arm64") export ARCH="linux-arm64" \
|
||||
;; \
|
||||
"linux/arm/v7") export ARCH="linux-arm" \
|
||||
;; \
|
||||
"windows/amd64") export ARCH="win-x64" \
|
||||
;; \
|
||||
*) echo "Error: Unsupported platform ${TARGETPLATFORM}" && exit 1 \
|
||||
;; \
|
||||
RUN \
|
||||
case "${TARGETPLATFORM}" in \
|
||||
"linux/amd64") export ARCH="linux-x64" \
|
||||
;; \
|
||||
"linux/arm64") export ARCH="linux-arm64" \
|
||||
;; \
|
||||
"linux/arm/v7") export ARCH="linux-arm" \
|
||||
;; \
|
||||
"windows/amd64") export ARCH="win-x64" \
|
||||
;; \
|
||||
*) echo "Error: Unsupported platform ${TARGETPLATFORM}" && exit 1 \
|
||||
;; \
|
||||
esac && \
|
||||
dotnet publish -o output/ -r "${ARCH}" -v m -f net6.0 -c Release -p:PublishSingleFile=true --self-contained false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue