Skip to content

Commit a5d40cb

Browse files
committed
change the docker base image in second stage build of client as the previous one does not have a shell
1 parent 9ddb0ed commit a5d40cb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

dockerfiles/migration/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
# Build the manager binary
21
FROM golang:1.20 as builder
32

43
WORKDIR /workspace
5-
# Copy the Go Modules manifests
64
COPY ./ ./
75
RUN go mod download
86

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

9+
RUN chmod +x /workspace/script/wait-for-clickhouse.sh
10+
1211
# Use distroless as minimal base image to package the manager binary
1312
# Refer to https://github.com/GoogleContainerTools/distroless for more details
14-
FROM gcr.io/distroless/static:nonroot
13+
FROM golang:alpine
1514
WORKDIR /
1615
COPY --from=builder /workspace/migration .
17-
COPY /workspace/sql /sql
18-
COPY /workspace/script /script
19-
RUN chmod +x /script/wait-for-clickhouse.sh
16+
COPY --from=builder /workspace/sql /sql
17+
COPY --from=builder /workspace/script /script
18+
2019
USER 65532:65532
2120

2221
ENTRYPOINT ["/migration"]

0 commit comments

Comments
 (0)