Merge "Fix: git commit id labels on images"

This commit is contained in:
Zuul 2018-10-03 00:14:27 +00:00 committed by Gerrit Code Review
commit 9625febab6
4 changed files with 14 additions and 3 deletions

View File

@ -22,7 +22,7 @@ PROXY ?= http://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
PUSH_IMAGE ?= false
LABEL ?= commit-id
COMMIT ?= commit-id
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
GO_BUILDER ?= docker.io/golang:1.10-stretch

View File

@ -13,6 +13,13 @@
# limitations under the License.
FROM ubuntu:16.04
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
LABEL org.opencontainers.image.url='https://airshipit.org'
LABEL org.opencontainers.image.documentation='https://airship-drydock.readthedocs.org'
LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-drydock'
LABEL org.opencontainers.image.vendor='The Airship Authors'
LABEL org.opencontainers.image.licenses='Apache-2.0'
ARG UBUNTU_REPO=http://archive.ubuntu.com/ubuntu
ARG TRUSTED_UBUNTU_REPO=no
ARG ALLOW_UNAUTHENTICATED=false

View File

@ -22,7 +22,11 @@ then
ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS}| --build-arg PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}"
fi
docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Dockerfile \
docker build --network host -t ${IMAGE} \
--label org.opencontainers.image.revision=${COMMIT} \
--label org.opencontainers.image.created="$(date --rfc-3339=seconds --utc)" \
--label org.opencontainers.image.title=${IMAGE_NAME} \
-f images/drydock/Dockerfile \
${ADDL_BUILD_ARGS} \
--build-arg BUILD_DIR=${BUILD_DIR} \
--build-arg http_proxy=${http_proxy} \
@ -31,4 +35,3 @@ docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Docke
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg no_proxy=${no_proxy} \
--build-arg NO_PROXY=${NO_PROXY} .

View File

@ -83,6 +83,7 @@
DOCKER_REGISTRY: "quay.io"
IMAGE_PREFIX: "airshipit"
IMAGE_TAG: "{{ item }}"
COMMIT: "{{ zuul.newrev }}"
PUSH_IMAGE: "true"
with_items: "{{ image_tags.stdout_lines }}"