Skip to content

Commit

Permalink
ci: fix dockerfile lint (#3474)
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
  • Loading branch information
sozercan and ritazh authored Aug 6, 2024
1 parent 94d4194 commit 7ec841a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BUILDERIMAGE="golang:1.22-bookworm"
# Refer to https://github.com/GoogleContainerTools/distroless for more details
ARG BASEIMAGE="gcr.io/distroless/static-debian12:nonroot"

FROM --platform=$BUILDPLATFORM $BUILDERIMAGE as builder
FROM --platform=$BUILDPLATFORM $BUILDERIMAGE AS builder

ARG TARGETPLATFORM
ARG TARGETOS
Expand Down
4 changes: 2 additions & 2 deletions crd.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM --platform=$TARGETPLATFORM registry.k8s.io/kubectl:v1.30.3 as builder
FROM --platform=$TARGETPLATFORM registry.k8s.io/kubectl:v1.30.3 AS builder

ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH

FROM scratch as build
FROM scratch AS build
USER 65532:65532
COPY --chown=65532:65532 * /crds/
COPY --from=builder /bin/kubectl /kubectl
Expand Down
4 changes: 2 additions & 2 deletions gator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BUILDERIMAGE="golang:1.22-bookworm"
# Refer to https://github.com/GoogleContainerTools/distroless for more details
ARG BASEIMAGE="gcr.io/distroless/static-debian12:nonroot"

FROM --platform=$BUILDPLATFORM $BUILDERIMAGE as builder
FROM --platform=$BUILDPLATFORM $BUILDERIMAGE AS builder

ARG TARGETPLATFORM
ARG TARGETOS
Expand All @@ -23,7 +23,7 @@ WORKDIR /go/src/github.com/open-policy-agent/gatekeeper/cmd/gator

RUN go build -mod vendor -a -ldflags "${LDFLAGS}" -o /gator

FROM --platform=$BUILDPLATFORM $BASEIMAGE as build
FROM --platform=$BUILDPLATFORM $BASEIMAGE AS build
USER 65532:65532
COPY --from=builder --chown=65532:65532 /gator /gator
ENTRYPOINT ["/gator"]

0 comments on commit 7ec841a

Please sign in to comment.