-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change the docker base image in second stage build of client as the p…
…revious one does not have a shell
- Loading branch information
Showing
1 changed file
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |