-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ae431a
commit f8db95f
Showing
1 changed file
with
5 additions
and
3 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,12 +1,14 @@ | ||
FROM openshift/origin-release:golang-1.21 AS build | ||
FROM golang:1.21 AS build | ||
WORKDIR /go/src | ||
COPY . /go/src | ||
RUN GIT_COMMIT=$(git rev-parse HEAD) && \ | ||
CGO_ENABLED=0 GOOS=linux go build -a -mod=readonly \ | ||
-ldflags "-X github.com/redhat-developer/gitops-backend/pkg/health.GitRevision=${GIT_COMMIT}" ./cmd/backend-http | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
WORKDIR /root/ | ||
# 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 | ||
WORKDIR / | ||
COPY --from=build /go/src/backend-http . | ||
EXPOSE 8080 | ||
ENTRYPOINT ["./backend-http"] |