Skip to content

Commit

Permalink
docker base image changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjino committed May 13, 2024
1 parent 5cb2363 commit 0ab7fd4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions dockerfiles/agent/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM golang:1.22 AS builder
FROM cgr.dev/chainguard/go:latest AS builder

WORKDIR /
COPY ./ ./

RUN go mod download
RUN CGO_ENABLED=0 go build -o ./build/agent agent/container/main.go

FROM scratch
FROM cgr.dev/chainguard/static:latest
COPY --from=builder ./build/agent agent

USER 65532:65532
Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/agent/git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM golang:1.22 AS builder
FROM cgr.dev/chainguard/go:latest AS builder

WORKDIR /
COPY ./ ./

RUN go mod download
RUN CGO_ENABLED=0 go build -o ./build/agent agent/git/main.go

FROM scratch
FROM cgr.dev/chainguard/static:latest
COPY --from=builder ./build/agent agent

USER 65532:65532
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 as builder
FROM cgr.dev/chainguard/go:latest AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -11,7 +11,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o k8smetri

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM golang:alpine
FROM cgr.dev/chainguard/static:latest
WORKDIR /
COPY --from=builder /workspace/k8smetrics_client .
USER 65532:65532
Expand Down
5 changes: 2 additions & 3 deletions dockerfiles/migration/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM golang:1.22 as builder

FROM cgr.dev/chainguard/go:latest AS builder
WORKDIR /workspace
COPY ./ ./
RUN go mod download
Expand All @@ -10,7 +9,7 @@ RUN chmod +x /workspace/script/wait-for-clickhouse.sh

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM golang:alpine
FROM cgr.dev/chainguard/wolfi-base
RUN apk add --no-cache netcat-openbsd
WORKDIR /
COPY --from=builder /workspace/migration .
Expand Down

0 comments on commit 0ab7fd4

Please sign in to comment.