Skip to content

Commit 940d8f6

Browse files
authored
MGMT-19819: Add the commit reference from which the image is built to the image (#166)
1 parent de2c9e4 commit 940d8f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ COPY . .
88
# Build
99
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1010

11+
# Extract the commit reference from which the image is built
12+
RUN git rev-parse --short HEAD > /commit-reference.txt
13+
1114
FROM quay-proxy.ci.openshift.org/openshift/ci:ocp_4.16_base-rhel9
1215

16+
# Copy the commit reference from the builder
17+
COPY --from=builder /commit-reference.txt /commit-reference.txt
18+
1319
WORKDIR /
1420
COPY --from=builder /workspace/manager .
1521
USER 65532:65532

0 commit comments

Comments
 (0)