Skip to content

Commit

Permalink
change the docker base image in second stage build of client as the p…
Browse files Browse the repository at this point in the history
…revious one does not have a shell
  • Loading branch information
vijeyash1 committed Sep 15, 2023
1 parent 9ddb0ed commit a5d40cb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions dockerfiles/migration/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Build the manager binary
FROM golang:1.20 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY ./ ./
RUN go mod download

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o migration cmd/cli/main.go

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 gcr.io/distroless/static:nonroot
FROM golang:alpine
WORKDIR /
COPY --from=builder /workspace/migration .
COPY /workspace/sql /sql
COPY /workspace/script /script
RUN chmod +x /script/wait-for-clickhouse.sh
COPY --from=builder /workspace/sql /sql
COPY --from=builder /workspace/script /script

USER 65532:65532

ENTRYPOINT ["/migration"]

0 comments on commit a5d40cb

Please sign in to comment.