1212endif
1313COMMIT_TIMESTAMP := $(shell $(CMD_GIT ) show --no-patch --format=% ct) -
1414ifeq ($(GITHUB_SHA ) ,)
15- COMMIT := $(shell $(CMD_GIT) rev-parse --short=8 HEAD)
15+ COMMIT := $(shell $(CMD_GIT) rev-parse HEAD)
16+ COMMIT_SHORT := $(shell $(CMD_GIT) rev-parse --short=8 HEAD)
1617else
17- COMMIT := $(shell echo $(GITHUB_SHA) | cut -c1-8)
18+ COMMIT := $(GITHUB_SHA)
19+ COMMIT_SHORT := $(shell echo $(GITHUB_SHA) | cut -c1-8)
1820endif
19- VERSION ?= $(if $(RELEASE_TAG ) ,$(RELEASE_TAG ) ,$(shell $(CMD_GIT ) describe --tags --match='v* ' || echo '$(subst /,-,$(BRANCH ) )$(COMMIT_TIMESTAMP )$(COMMIT ) ') )
21+ VERSION ?= $(if $(RELEASE_TAG ) ,$(RELEASE_TAG ) ,$(shell $(CMD_GIT ) describe --tags --match='v* ' || echo '$(subst /,-,$(BRANCH ) )$(COMMIT_TIMESTAMP )$(COMMIT_SHORT ) ') )
2022OUT_DOCKER ?= ghcr.io/parca-dev/parca
2123
2224ENABLE_RACE := no
@@ -154,6 +156,11 @@ container-dev:
154156.PHONY : container
155157container :
156158 podman build \
159+ --annotation " org.opencontainers.image.created=1970-01-01T00:00:00Z" \
160+ --annotation " org.opencontainers.image.revision=$( COMMIT) " \
161+ --annotation " org.opencontainers.image.source=https://github.com/parca-dev/parca" \
162+ --annotation " org.opencontainers.image.url=https://github.com/parca-dev/parca" \
163+ --annotation " org.opencontainers.image.version=$( VERSION) " \
157164 --platform linux/amd64,linux/arm64 \
158165 --timestamp 0 \
159166 --manifest $(OUT_DOCKER ) :$(VERSION ) .
@@ -165,7 +172,7 @@ push-container:
165172.PHONY : sign-container
166173sign-container :
167174 crane digest $(OUT_DOCKER ) :$(VERSION )
168- cosign sign --yes -a GIT_HASH=$(COMMIT ) -a GIT_VERSION=$(VERSION ) $(OUT_DOCKER ) @$(shell crane digest $(OUT_DOCKER ) :$(VERSION ) )
175+ cosign sign --yes -a GIT_HASH=$(COMMIT_SHORT ) -a GIT_VERSION=$(VERSION ) $(OUT_DOCKER ) @$(shell crane digest $(OUT_DOCKER ) :$(VERSION ) )
169176
170177.PHONY : push-quay-container
171178push-quay-container :
0 commit comments