Skip to content

Commit f8db95f

Browse files
committed
Replace Go image in the Dockerfile
1 parent 1ae431a commit f8db95f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
FROM openshift/origin-release:golang-1.21 AS build
1+
FROM golang:1.21 AS build
22
WORKDIR /go/src
33
COPY . /go/src
44
RUN GIT_COMMIT=$(git rev-parse HEAD) && \
55
CGO_ENABLED=0 GOOS=linux go build -a -mod=readonly \
66
-ldflags "-X github.com/redhat-developer/gitops-backend/pkg/health.GitRevision=${GIT_COMMIT}" ./cmd/backend-http
77

8-
FROM registry.access.redhat.com/ubi8/ubi-minimal
9-
WORKDIR /root/
8+
# Use distroless as minimal base image to package the manager binary
9+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
10+
FROM gcr.io/distroless/static:nonroot
11+
WORKDIR /
1012
COPY --from=build /go/src/backend-http .
1113
EXPOSE 8080
1214
ENTRYPOINT ["./backend-http"]

0 commit comments

Comments
 (0)