-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have separate build arguments for
ARCH
and GOARCH
- Loading branch information
M. Mert Yildiran
committed
Jan 17, 2022
1 parent
5a81061
commit 0b6d949
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
ARG ARCH= | ||
ARG GOARCH= | ||
FROM golang:1.16-alpine AS builder | ||
RUN apk add make perl-utils | ||
WORKDIR /tmp | ||
COPY server server | ||
COPY Makefile . | ||
RUN make build GOOS=linux GOARCH=${ARCH} | ||
RUN make build GOOS=linux GOARCH=${GOARCH} | ||
|
||
FROM ${ARCH}/alpine:3.15 | ||
COPY --from=builder ["/tmp/build/basenine_linux_${ARCH}", "./basenine"] | ||
COPY --from=builder ["/tmp/build/basenine_linux_${GOARCH}", "./basenine"] | ||
ENTRYPOINT "./basenine" |