Browse Source

Merge "Fix: git commit id labels on images"

Zuul 6 months ago
parent
commit
9625febab6

+ 1
- 1
Makefile View File

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

+ 7
- 0
images/drydock/Dockerfile View File

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

+ 5
- 2
tools/drydock_image_build.sh View File

@@ -22,7 +22,11 @@ then
22 22
   ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS}| --build-arg PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}"
23 23
 fi
24 24
 
25
-docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Dockerfile \
25
+docker 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 30
   ${ADDL_BUILD_ARGS} \
27 31
   --build-arg BUILD_DIR=${BUILD_DIR} \
28 32
   --build-arg http_proxy=${http_proxy} \
@@ -31,4 +35,3 @@ docker build --network host -t ${IMAGE} --label ${LABEL} -f images/drydock/Docke
31 35
   --build-arg HTTPS_PROXY=${HTTPS_PROXY} \
32 36
   --build-arg no_proxy=${no_proxy} \
33 37
   --build-arg NO_PROXY=${NO_PROXY} .
34
-

+ 1
- 0
tools/gate/playbooks/docker-image-build.yaml View File

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

Loading…
Cancel
Save