summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-29 21:38:56 +0000
committerGerrit Code Review <review@openstack.org>2018-10-29 21:38:56 +0000
commite80d4e58ebd2ad00ca33037e8aef2447b1b7859f (patch)
treeb29e862cc00c65418da5b175e690ead7dca35407
parentd1d5b88d3db637a3fa6671a0cd04f9c817a749da (diff)
parentc3a364c153a3f37c22ff8e56dbdd56323923f5fd (diff)
Merge "Fix: git commit id labels on images"
-rw-r--r--Makefile16
-rw-r--r--images/maas-rack-controller/Dockerfile8
-rw-r--r--images/maas-region-controller/Dockerfile7
-rw-r--r--images/sstream-cache/Dockerfile7
-rw-r--r--tools/gate/playbooks/docker-image-build.yaml1
5 files changed, 34 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 67adac3..949a1ed 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ PROXY ?= http://proxy.foo.com:8000
26NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local 26NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
27USE_PROXY ?= false 27USE_PROXY ?= false
28PUSH_IMAGE ?= false 28PUSH_IMAGE ?= false
29LABEL ?= commit-id 29COMMIT ?= commit-id
30IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache 30IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache
31BUILD_DIR := $(shell mktemp -d) 31BUILD_DIR := $(shell mktemp -d)
32HELM := $(BUILD_DIR)/helm 32HELM := $(BUILD_DIR)/helm
@@ -67,7 +67,11 @@ helm-install:
67.PHONY: build 67.PHONY: build
68build: 68build:
69ifeq ($(USE_PROXY), true) 69ifeq ($(USE_PROXY), true)
70 docker build -t $(IMAGE) --network=host --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \ 70 docker build -t $(IMAGE) --network=host \
71 --label "org.opencontainers.image.revision=$(COMMIT)" \
72 --label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
73 --label "org.opencontainers.image.title=$(IMAGE_NAME)" \
74 -f $(IMAGE_DIR)/Dockerfile \
71 --build-arg FROM=$(UBUNTU_BASE_IMAGE) \ 75 --build-arg FROM=$(UBUNTU_BASE_IMAGE) \
72 --build-arg http_proxy=$(PROXY) \ 76 --build-arg http_proxy=$(PROXY) \
73 --build-arg https_proxy=$(PROXY) \ 77 --build-arg https_proxy=$(PROXY) \
@@ -75,10 +79,14 @@ ifeq ($(USE_PROXY), true)
75 --build-arg HTTPS_PROXY=$(PROXY) \ 79 --build-arg HTTPS_PROXY=$(PROXY) \
76 --build-arg no_proxy=$(NO_PROXY) \ 80 --build-arg no_proxy=$(NO_PROXY) \
77 --build-arg NO_PROXY=$(NO_PROXY) \ 81 --build-arg NO_PROXY=$(NO_PROXY) \
78 --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \ 82 --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
79 $(IMAGE_DIR) 83 $(IMAGE_DIR)
80else 84else
81 docker build -t $(IMAGE) --network=host --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \ 85 docker build -t $(IMAGE) --network=host \
86 --label "org.opencontainers.image.revision=$(COMMIT)" \
87 --label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
88 --label "org.opencontainers.image.title=$(IMAGE_NAME)" \
89 -f $(IMAGE_DIR)/Dockerfile \
82 --build-arg FROM=$(UBUNTU_BASE_IMAGE) \ 90 --build-arg FROM=$(UBUNTU_BASE_IMAGE) \
83 --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \ 91 --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
84 $(IMAGE_DIR) 92 $(IMAGE_DIR)
diff --git a/images/maas-rack-controller/Dockerfile b/images/maas-rack-controller/Dockerfile
index 0b9b7f4..73510ac 100644
--- a/images/maas-rack-controller/Dockerfile
+++ b/images/maas-rack-controller/Dockerfile
@@ -1,10 +1,16 @@
1ARG FROM=ubuntu:16.04 1ARG FROM=ubuntu:16.04
2FROM ${FROM} 2FROM ${FROM}
3 3
4LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
5LABEL org.opencontainers.image.url='https://airshipit.org'
6LABEL org.opencontainers.image.documentation='https://github.com/openstack/airship-maas'
7LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-maas'
8LABEL org.opencontainers.image.vendor='The Airship Authors'
9LABEL org.opencontainers.image.licenses='Apache-2.0'
10
4ENV DEBIAN_FRONTEND noninteractive 11ENV DEBIAN_FRONTEND noninteractive
5ENV container docker 12ENV container docker
6 13
7
8# everything else below is to setup maas into the systemd initialized 14# everything else below is to setup maas into the systemd initialized
9# container based on ubuntu 16.04 15# container based on ubuntu 16.04
10RUN apt-get -qq update && \ 16RUN apt-get -qq update && \
diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile
index 2da446c..bbcaadc 100644
--- a/images/maas-region-controller/Dockerfile
+++ b/images/maas-region-controller/Dockerfile
@@ -1,6 +1,13 @@
1ARG FROM=ubuntu:16.04 1ARG FROM=ubuntu:16.04
2FROM ${FROM} 2FROM ${FROM}
3 3
4LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
5LABEL org.opencontainers.image.url='https://airshipit.org'
6LABEL org.opencontainers.image.documentation='https://github.com/openstack/airship-maas'
7LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-maas'
8LABEL org.opencontainers.image.vendor='The Airship Authors'
9LABEL org.opencontainers.image.licenses='Apache-2.0'
10
4ENV DEBIAN_FRONTEND noninteractive 11ENV DEBIAN_FRONTEND noninteractive
5ENV container docker 12ENV container docker
6 13
diff --git a/images/sstream-cache/Dockerfile b/images/sstream-cache/Dockerfile
index c12c244..18d249d 100644
--- a/images/sstream-cache/Dockerfile
+++ b/images/sstream-cache/Dockerfile
@@ -1,6 +1,13 @@
1ARG FROM=ubuntu:16.04 1ARG FROM=ubuntu:16.04
2FROM ${FROM} 2FROM ${FROM}
3 3
4LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
5LABEL org.opencontainers.image.url='https://airshipit.org'
6LABEL org.opencontainers.image.documentation='https://github.com/openstack/airship-maas'
7LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-maas'
8LABEL org.opencontainers.image.vendor='The Airship Authors'
9LABEL org.opencontainers.image.licenses='Apache-2.0'
10
4ARG SSTREAM_IMAGE=https://images.maas.io/ephemeral-v3/daily/ 11ARG SSTREAM_IMAGE=https://images.maas.io/ephemeral-v3/daily/
5ENV IMAGE_SRC ${SSTREAM_IMAGE} 12ENV IMAGE_SRC ${SSTREAM_IMAGE}
6 13
diff --git a/tools/gate/playbooks/docker-image-build.yaml b/tools/gate/playbooks/docker-image-build.yaml
index 31806f1..116cd4c 100644
--- a/tools/gate/playbooks/docker-image-build.yaml
+++ b/tools/gate/playbooks/docker-image-build.yaml
@@ -116,6 +116,7 @@
116 DOCKER_REGISTRY: "quay.io" 116 DOCKER_REGISTRY: "quay.io"
117 IMAGE_PREFIX: "airshipit" 117 IMAGE_PREFIX: "airshipit"
118 IMAGE_TAG: "{{ item }}" 118 IMAGE_TAG: "{{ item }}"
119 COMMIT: "{{ zuul.newrev }}"
119 PUSH_IMAGE: "true" 120 PUSH_IMAGE: "true"
120 with_items: "{{ image_tags.stdout_lines }}" 121 with_items: "{{ image_tags.stdout_lines }}"
121 122