Skip to content

Commit

Permalink
chore: support sidecarcontainer Dockerfile multiple architecture
Browse files Browse the repository at this point in the history
Signed-off-by: kahirokunn <[email protected]>
  • Loading branch information
kahirokunn committed Aug 21, 2023
1 parent be33765 commit 66ac14a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# https://hub.docker.com/_/golang
FROM golang:1.15 as builder

ARG TARGETOS
ARG TARGETARCH

# Create and change to the app directory.
WORKDIR /app

Expand All @@ -16,7 +19,7 @@ COPY . ./

# Build the binary.
# -mod=readonly ensures immutable go.mod and go.sum in container builds.
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o sidecarcontainer
RUN CGO_ENABLED=0 GOOS=linux GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=readonly -v -o sidecarcontainer

# Use the official Alpine image for a lean production container.
# https://hub.docker.com/_/alpine
Expand Down

0 comments on commit 66ac14a

Please sign in to comment.