Skip to content

Commit

Permalink
Set labels on the Docker image (#57)
Browse files Browse the repository at this point in the history
To improve traceability of our Docker image and add other useful
metadata let's set a few OCI labels, plus a Datadog label to make
life easier for users of Datadog without impacting others.

There no foolproof way of detecting the repository we're building
from so the repository URL is unfortunately hardcoded.
  • Loading branch information
magnusbaeck authored May 4, 2023
1 parent 4b310fe commit d4f7bb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ stop:
# Build a docker using the production Dockerfile
.PHONY: docker
docker:
docker build -t $(DOCKER_REGISTRY)/$(DEPLOY):$(RELEASE_VERSION) -f ./deploy/$(DEPLOY)/Dockerfile .
docker build --build-arg revision=$(RELEASE_VERSION) -t $(DOCKER_REGISTRY)/$(DEPLOY):$(RELEASE_VERSION) -f ./deploy/$(DEPLOY)/Dockerfile .

.PHONY: push
push:
Expand Down
6 changes: 6 additions & 0 deletions deploy/goer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ RUN make build
FROM alpine:3.13.5
ENTRYPOINT ["/app/goer"]
COPY --from=build /tmp/goer/bin/goer /app/goer

ARG revision
LABEL com.datadoghq.tags.version="${revision}" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.revision="${revision}" \
org.opencontainers.image.source="https://github.com/eiffel-community/eiffel-goer"

0 comments on commit d4f7bb3

Please sign in to comment.