summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-03 00:14:27 +0000
committerGerrit Code Review <review@openstack.org>2018-10-03 00:14:27 +0000
commit9625febab6807f72d1ba0b44f9311dcff658389e (patch)
treef47a7cecab01f41cfc1b01281411a9401d4ef0cc
parent43efbb0c6330b0b44813a6a5447720e3f54754f1 (diff)
parent34f7d760e83709b2ac1555cc0b6aa5e1f3a8561c (diff)
Merge "Fix: git commit id labels on images"
-rw-r--r--Makefile2
-rw-r--r--images/drydock/Dockerfile7
-rwxr-xr-xtools/drydock_image_build.sh7
-rw-r--r--tools/gate/playbooks/docker-image-build.yaml1
4 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 39301ce..3aa9453 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ PROXY ?= http://proxy.foo.com:8000
22NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local 22NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
23USE_PROXY ?= false 23USE_PROXY ?= false
24PUSH_IMAGE ?= false 24PUSH_IMAGE ?= false
25LABEL ?= commit-id 25COMMIT ?= commit-id
26IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} 26IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
27GO_BUILDER ?= docker.io/golang:1.10-stretch 27GO_BUILDER ?= docker.io/golang:1.10-stretch
28 28
diff --git a/images/drydock/Dockerfile b/images/drydock/Dockerfile
index 4db6f5c..7378bb2 100644
--- a/images/drydock/Dockerfile
+++ b/images/drydock/Dockerfile
@@ -13,6 +13,13 @@
13# limitations under the License. 13# limitations under the License.
14FROM ubuntu:16.04 14FROM ubuntu:16.04
15 15
16LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
17LABEL org.opencontainers.image.url='https://airshipit.org'
18LABEL org.opencontainers.image.documentation='https://airship-drydock.readthedocs.org'
19LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-drydock'
20LABEL org.opencontainers.image.vendor='The Airship Authors'
21LABEL org.opencontainers.image.licenses='Apache-2.0'
22
16ARG UBUNTU_REPO=http://archive.ubuntu.com/ubuntu 23ARG UBUNTU_REPO=http://archive.ubuntu.com/ubuntu
17ARG TRUSTED_UBUNTU_REPO=no 24ARG TRUSTED_UBUNTU_REPO=no
18ARG ALLOW_UNAUTHENTICATED=false 25ARG ALLOW_UNAUTHENTICATED=false
diff --git a/tools/drydock_image_build.sh b/tools/drydock_image_build.sh
index cc54b97..41c2a4d 100755
--- a/tools/drydock_image_build.sh
+++ b/tools/drydock_image_build.sh
@@ -22,7 +22,11 @@ then
22 ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS}| --build-arg PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}" 22 ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS}| --build-arg PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}"
23fi 23fi
24 24
25docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Dockerfile \ 25docker build --network host -t ${IMAGE} \
26 --label org.opencontainers.image.revision=${COMMIT} \
27 --label org.opencontainers.image.created="$(date --rfc-3339=seconds --utc)" \
28 --label org.opencontainers.image.title=${IMAGE_NAME} \
29 -f images/drydock/Dockerfile \
26 ${ADDL_BUILD_ARGS} \ 30 ${ADDL_BUILD_ARGS} \
27 --build-arg BUILD_DIR=${BUILD_DIR} \ 31 --build-arg BUILD_DIR=${BUILD_DIR} \
28 --build-arg http_proxy=${http_proxy} \ 32 --build-arg http_proxy=${http_proxy} \
@@ -31,4 +35,3 @@ docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Docke
31 --build-arg HTTPS_PROXY=${HTTPS_PROXY} \ 35 --build-arg HTTPS_PROXY=${HTTPS_PROXY} \
32 --build-arg no_proxy=${no_proxy} \ 36 --build-arg no_proxy=${no_proxy} \
33 --build-arg NO_PROXY=${NO_PROXY} . 37 --build-arg NO_PROXY=${NO_PROXY} .
34
diff --git a/tools/gate/playbooks/docker-image-build.yaml b/tools/gate/playbooks/docker-image-build.yaml
index 63c5185..aa84bf1 100644
--- a/tools/gate/playbooks/docker-image-build.yaml
+++ b/tools/gate/playbooks/docker-image-build.yaml
@@ -83,6 +83,7 @@
83 DOCKER_REGISTRY: "quay.io" 83 DOCKER_REGISTRY: "quay.io"
84 IMAGE_PREFIX: "airshipit" 84 IMAGE_PREFIX: "airshipit"
85 IMAGE_TAG: "{{ item }}" 85 IMAGE_TAG: "{{ item }}"
86 COMMIT: "{{ zuul.newrev }}"
86 PUSH_IMAGE: "true" 87 PUSH_IMAGE: "true"
87 with_items: "{{ image_tags.stdout_lines }}" 88 with_items: "{{ image_tags.stdout_lines }}"
88 89