Skip to content

Commit 184cdc8

Browse files
authored
Add OCI image labels with version info (#1772)
1 parent 7d3166a commit 184cdc8

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ jobs:
163163
mkdir -p build/linux-{amd64,arm64}
164164
tar -zxvf artifacts/nebula-linux-amd64.tar.gz -C build/linux-amd64/
165165
tar -zxvf artifacts/nebula-linux-arm64.tar.gz -C build/linux-arm64/
166-
docker buildx build . --push -f docker/Dockerfile --platform linux/amd64,linux/arm64 --tag "${DOCKER_IMAGE_REPO}:${DOCKER_IMAGE_TAG}" --tag "${DOCKER_IMAGE_REPO}:${GITHUB_REF#refs/tags/v}"
166+
docker buildx build . --push -f docker/Dockerfile --platform linux/amd64,linux/arm64 \
167+
--build-arg VERSION="${GITHUB_REF#refs/tags/v}" \
168+
--build-arg REVISION="${GITHUB_SHA}" \
169+
--tag "${DOCKER_IMAGE_REPO}:${DOCKER_IMAGE_TAG}" --tag "${DOCKER_IMAGE_REPO}:${GITHUB_REF#refs/tags/v}"
167170
168171
release:
169172
name: Create and Upload Release

docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
FROM gcr.io/distroless/static:latest
22

33
ARG TARGETOS TARGETARCH
4+
5+
ARG VERSION=dev
6+
ARG REVISION=unknown
7+
LABEL org.opencontainers.image.title="nebula" \
8+
org.opencontainers.image.description="A scalable overlay networking tool with a focus on performance, simplicity and security" \
9+
org.opencontainers.image.vendor="Nebula OSS" \
10+
org.opencontainers.image.source="https://github.com/slackhq/nebula" \
11+
org.opencontainers.image.version="${VERSION}" \
12+
org.opencontainers.image.revision="${REVISION}"
13+
414
COPY build/$TARGETOS-$TARGETARCH/nebula /nebula
515
COPY build/$TARGETOS-$TARGETARCH/nebula-cert /nebula-cert
616

0 commit comments

Comments
 (0)