diff --git a/Containerfile b/Containerfile
index 68a8297..9d3da64 100644
--- a/Containerfile
+++ b/Containerfile
@@ -6,7 +6,9 @@ RUN go env -w GOPROXY=$GOPROXY
RUN cd /build/bib && go mod download
COPY build.sh /build
COPY bib /build/bib
+COPY .git /build
WORKDIR /build
+RUN git rev-parse --short HEAD
RUN ./build.sh
FROM registry.fedoraproject.org/fedora:40
seems to be not working even though during the build git rev-parse will print the right output. When running
However doing the same inside the Containerfile does not yield the same result, it will just not contain a vcs.revision in buildinfo for unknown reasons.
diff --git a/build.sh b/build.sh
index 1c19119..29d2250 100755
--- a/build.sh
+++ b/build.sh
@@ -8,7 +8,9 @@ CONTAINERS_STORAGE_THIN_TAGS="containers_image_openpgp exclude_graphdriver_btrfs
cd bib
set -x
-go build -tags "${CONTAINERS_STORAGE_THIN_TAGS}" -o ../bin/bootc-image-builder ./cmd/bootc-image-builder
+go build -buildvcs=true -tags "${CONTAINERS_STORAGE_THIN_TAGS}" -o ../bin/bootc-image-builder ./cmd/bootc-image-builder
+git rev-parse --short HEAD
+strings ../bin/bootc-image-builder |grep vcs
# expand the list as we support more architectures
for arch in amd64 arm64; do
I'm parking this issue for now but I'm a bit puzzled why this is not working.
While looking at https://github.com/osbuild/bootc-image-builder/pull/489#issuecomment-2197787396 I noticed we are not embedding the git revision of bib in our container. It seems like nice feature so I looked into enabling it. My approach so far:
seems to be not working even though during the build
git rev-parse
will print the right output. When runningHowever doing the same inside the Containerfile does not yield the same result, it will just not contain a vcs.revision in buildinfo for unknown reasons.
I'm parking this issue for now but I'm a bit puzzled why this is not working.