Skip to content

Commit

Permalink
fix: correct bullseye Dockerfile (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom authored Oct 25, 2022
1 parent 0521d05 commit 15a97e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile.bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
# Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1 as build

WORKDIR /go/src/cloudsql-proxy
WORKDIR /go/src/cloud-sql-proxy
COPY . .

ARG TARGETOS
ARG TARGETARCH

RUN go get ./...
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags "-X main.metadataString=container.bullseye" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
go build -ldflags "-X main.metadataString=container.bullseye"

# Final stage
FROM debian:bullseye
Expand All @@ -35,4 +35,5 @@ RUN groupadd -g 65532 -r nonroot && useradd -u 65532 -g 65532 -r nonroot
# Set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
USER 65532

COPY --from=build --chown=nonroot /go/src/cloudsql-proxy/cloud_sql_proxy /cloud_sql_proxy
COPY --from=build --chown=nonroot /go/src/cloud-sql-proxy/cloud-sql-proxy /cloud-sql-proxy
ENTRYPOINT ["/cloud-sql-proxy"]

0 comments on commit 15a97e7

Please sign in to comment.