Skip to content

Commit

Permalink
fix: correctly apply container image labels (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom committed Dec 8, 2023
1 parent 46088f1 commit 15bbe33
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1 as build

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

WORKDIR /go/src/alloydb-auth-proxy
COPY . .

Expand All @@ -29,6 +27,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \

# Final Stage
FROM gcr.io/distroless/static:nonroot@sha256:91ca4720011393f4d4cab3a01fa5814ee2714b7d40e6c74f2505f74168398ca9

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

COPY --from=build --chown=nonroot /go/src/alloydb-auth-proxy/alloydb-auth-proxy /alloydb-auth-proxy
# set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
USER 65532
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1-alpine as build

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

WORKDIR /go/src/alloydb-auth-proxy
COPY . .

Expand All @@ -29,6 +27,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \

# Final stage
FROM alpine:3@sha256:34871e7290500828b39e22294660bee86d966bc0017544e848dd9a255cdf59e0

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

RUN apk add --no-cache \
ca-certificates \
libc6-compat
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1 as build

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

WORKDIR /go/src/alloydb-auth-proxy
COPY . .

Expand All @@ -29,6 +27,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \

# Final stage
FROM debian:bullseye@sha256:ab2b95aa8d7d6d54866b92c322cf0693933c1ae8038652f24ddfda1d1763a45a

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

RUN apt-get update && apt-get install -y ca-certificates
# Install fuse and allow enable non-root users to mount
RUN apt-get update && apt-get install -y fuse && sed -i 's/^#user_allow_other$/user_allow_other/g' /etc/fuse.conf
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.buster
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# Use the latest stable golang 1.x to compile to a binary
FROM --platform=$BUILDPLATFORM golang:1 as build

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

WORKDIR /go/src/alloydb-auth-proxy
COPY . .

Expand All @@ -29,6 +27,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \

# Final stage
FROM debian:buster@sha256:46ca02d33c65ab188d6e56f26c323bf1aa9a99074f2f54176fdc3884304f58b8

LABEL org.opencontainers.image.source="https://github.com/GoogleCloudPlatform/alloydb-auth-proxy"

RUN apt-get update && apt-get install -y ca-certificates
# Install fuse and allow enable non-root users to mount
RUN apt-get update && apt-get install -y fuse && sed -i 's/^#user_allow_other$/user_allow_other/g' /etc/fuse.conf
Expand Down

0 comments on commit 15bbe33

Please sign in to comment.