From a5d40cb5ab7a34149f5e8ac08afa15c45f2cfb8a Mon Sep 17 00:00:00 2001 From: vijeyash Date: Fri, 15 Sep 2023 11:52:03 +0530 Subject: [PATCH] change the docker base image in second stage build of client as the previous one does not have a shell --- dockerfiles/migration/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dockerfiles/migration/Dockerfile b/dockerfiles/migration/Dockerfile index dbd4949e..0281813d 100644 --- a/dockerfiles/migration/Dockerfile +++ b/dockerfiles/migration/Dockerfile @@ -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"]