Skip to content

Commit

Permalink
MGMT-19819: Add the commit reference from which the image is built to…
Browse files Browse the repository at this point in the history
… the image (#7241)
  • Loading branch information
danmanor authored Jan 29, 2025
1 parent 7490e1a commit c2bed9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile.assisted-service
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ RUN cd ./cmd/operator && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /bu
RUN cd ./cmd/webadmission && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/assisted-service-admission
RUN cd ./cmd/agentbasedinstaller/client && CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/agent-installer-client

# Extract the commit reference from which the image is built
RUN git rev-parse --short HEAD > /commit-reference.txt

# Create final image
FROM quay.io/centos/centos:stream$RHEL_VERSION

Expand Down Expand Up @@ -95,6 +98,9 @@ RUN ln -s /usr/local/bin/agent-installer-client /agent-based-installer-register-
ENV GODEBUG=madvdontneed=1
ENV GOGC=50

# Extract the commit reference from which the image is built
COPY --from=builder /commit-reference.txt /commit-reference.txt

USER $UID:$GID

CMD ["/assisted-service"]

0 comments on commit c2bed9b

Please sign in to comment.