Add build_id dockerfile label
This commit is contained in:
parent
96d190d708
commit
bf11584dbd
2 changed files with 6 additions and 0 deletions
3
Makefile
3
Makefile
|
@ -39,6 +39,7 @@ E2E_CHECK_LEAKS ?=
|
||||||
|
|
||||||
REPO_INFO ?= $(shell git config --get remote.origin.url)
|
REPO_INFO ?= $(shell git config --get remote.origin.url)
|
||||||
COMMIT_SHA ?= git-$(shell git rev-parse --short HEAD)
|
COMMIT_SHA ?= git-$(shell git rev-parse --short HEAD)
|
||||||
|
BUILD_ID ?= "UNSET"
|
||||||
|
|
||||||
PKG = k8s.io/ingress-nginx
|
PKG = k8s.io/ingress-nginx
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ image: clean-image ## Build image for a particular arch.
|
||||||
--build-arg VERSION="$(TAG)" \
|
--build-arg VERSION="$(TAG)" \
|
||||||
--build-arg TARGETARCH="$(ARCH)" \
|
--build-arg TARGETARCH="$(ARCH)" \
|
||||||
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
|
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
|
||||||
|
--build-arg BUILD_ID="$(BUILD_ID)" \
|
||||||
-t $(REGISTRY)/controller:$(TAG) rootfs
|
-t $(REGISTRY)/controller:$(TAG) rootfs
|
||||||
|
|
||||||
.PHONY: clean-image
|
.PHONY: clean-image
|
||||||
|
@ -215,4 +217,5 @@ release: ensure-buildx clean
|
||||||
--build-arg BASE_IMAGE="$(BASE_IMAGE)" \
|
--build-arg BASE_IMAGE="$(BASE_IMAGE)" \
|
||||||
--build-arg VERSION="$(TAG)" \
|
--build-arg VERSION="$(TAG)" \
|
||||||
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
|
--build-arg COMMIT_SHA="$(COMMIT_SHA)" \
|
||||||
|
--build-arg BUILD_ID="$(BUILD_ID)" \
|
||||||
-t $(REGISTRY)/controller:$(TAG) rootfs
|
-t $(REGISTRY)/controller:$(TAG) rootfs
|
||||||
|
|
|
@ -19,6 +19,7 @@ FROM ${BASE_IMAGE}
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG COMMIT_SHA
|
ARG COMMIT_SHA
|
||||||
|
ARG BUILD_ID=UNSET
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="NGINX Ingress Controller for Kubernetes"
|
LABEL org.opencontainers.image.title="NGINX Ingress Controller for Kubernetes"
|
||||||
LABEL org.opencontainers.image.documentation="https://kubernetes.github.io/ingress-nginx/"
|
LABEL org.opencontainers.image.documentation="https://kubernetes.github.io/ingress-nginx/"
|
||||||
|
@ -28,6 +29,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||||
LABEL org.opencontainers.image.version="${VERSION}"
|
LABEL org.opencontainers.image.version="${VERSION}"
|
||||||
LABEL org.opencontainers.image.revision="${COMMIT_SHA}"
|
LABEL org.opencontainers.image.revision="${COMMIT_SHA}"
|
||||||
|
|
||||||
|
LABEL build_id="${BUILD_ID}"
|
||||||
|
|
||||||
WORKDIR /etc/nginx
|
WORKDIR /etc/nginx
|
||||||
|
|
||||||
RUN apk update \
|
RUN apk update \
|
||||||
|
|
Loading…
Reference in a new issue