chore: review

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2024-10-04 15:53:04 +02:00 committed by Niccolò Fei
parent 6138227709
commit 1e2dd0084c
3 changed files with 7 additions and 2 deletions

View File

@ -12,7 +12,7 @@ COPY ../go.sum go.sum
RUN go mod download RUN go mod download
# Copy the go source # Copy the go source
COPY ../cmd/instance/main.go cmd/instance/main.go COPY ../cmd/operator/main.go cmd/operator/main.go
COPY ../api api/ COPY ../api api/
COPY ../internal internal/ COPY ../internal internal/
@ -21,7 +21,8 @@ COPY ../internal internal/
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/instance/main.go RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/operator/main.go
# Use distroless as minimal base image to package the manager binary # Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details # Refer to https://github.com/GoogleContainerTools/distroless for more details

View File

@ -24,3 +24,4 @@ FROM gcr.io/distroless/python3:debug
COPY --from=pythonbuilder /new-usr/* /usr/ COPY --from=pythonbuilder /new-usr/* /usr/
COPY --from=gobuilder /build/instance /usr/local/bin/instance COPY --from=gobuilder /build/instance /usr/local/bin/instance
USER 26:26 USER 26:26
ENTRYPOINT ["/usr/local/bin/instance"]

View File

@ -85,6 +85,9 @@ func (impl LifecycleImplementation) LifecycleHook(
Value: "/controller/wal-restore-spool", Value: "/controller/wal-restore-spool",
}, },
}, },
Command: []string{
"/usr/local/bin/instance",
},
}, true) }, true)
if err != nil { if err != nil {
return nil, err return nil, err