Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sheurich committed Feb 28, 2024
1 parent e8d1b11 commit 55ee4f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 43 deletions.
21 changes: 9 additions & 12 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# syntax=docker/dockerfile:1

# The build argument `APP` is used to select the appropriate binary
# for the target OS.
# The binary specified by `APP` must exist in the `dist-files` stage.
ARG APP=${APP:-pebble}

# Set the base image dynamically based on the target OS
FROM --platform=${TARGETPLATFORM} \
alpine AS linux-base
FROM --platform=${TARGETPLATFORM} \
mcr.microsoft.com/windows/nanoserver:ltsc2022 AS windows-base
FROM --platform=${TARGETPLATFORM} alpine AS linux-base
FROM --platform=${TARGETPLATFORM} mcr.microsoft.com/windows/nanoserver:ltsc2022 AS windows-base

# Use build arguments to select the appropriate binary for Linux
FROM linux-base AS linux
ARG APP
ARG TARGETOS
ARG TARGETARCH
COPY --from=dist-files /${APP} /
CMD [ "${APP}" ]
COPY --from=dist-files /${APP} /app
CMD /app

# Use build arguments to select the appropriate binary for Windows
FROM windows-base AS windows
ARG APP
ARG TARGETOS
ARG TARGETARCH
COPY --from=dist-files /${APP}.exe /
CMD [ "${APP}.exe" ]
COPY --from=dist-files /${APP}.exe /app.exe
CMD /app.exe

# Final stage: dynamically select between Linux and Windows stages based on TARGETOS argument
FROM ${TARGETOS} AS final
31 changes: 0 additions & 31 deletions build.sh

This file was deleted.

0 comments on commit 55ee4f3

Please sign in to comment.