Browse Source

Merge "Fix: git commit id labels on images"

changes/15/606215/1
Zuul 3 years ago
committed by Gerrit Code Review
parent
commit
12d79ce423
  1. 26
      Makefile
  2. 7
      images/airflow/Dockerfile
  3. 7
      images/shipyard/Dockerfile
  4. 1
      tools/gate/roles/build-images/tasks/airship-shipyard.yaml

26
Makefile

@ -18,7 +18,7 @@ BUILD_CTX ?= src/bin
IMAGE_PREFIX ?= airshipit
IMAGE_TAG ?= untagged
IMAGE_NAME := airflow shipyard
LABEL ?= commit-id
COMMIT ?= commit-id
DOCKER_REGISTRY ?= quay.io
PUSH_IMAGE ?= false
@ -83,7 +83,11 @@ run:
.PHONY: build_airflow
build_airflow:
ifeq ($(USE_PROXY), true)
docker build --network host -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \
docker build --network host -t $(IMAGE) \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
--build-arg http_proxy=$(PROXY) \
--build-arg https_proxy=$(PROXY) \
@ -93,7 +97,11 @@ ifeq ($(USE_PROXY), true)
--build-arg NO_PROXY=$(NO_PROXY) \
--build-arg ctx_base=$(BUILD_CTX) .
else
docker build --network host -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \
docker build --network host -t $(IMAGE) \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
--build-arg ctx_base=$(BUILD_CTX) .
endif
@ -104,7 +112,11 @@ endif
.PHONY: build_shipyard
build_shipyard:
ifeq ($(USE_PROXY), true)
docker build --network host -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \
docker build --network host -t $(IMAGE) \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(PYTHON_BASE_IMAGE) \
--build-arg http_proxy=$(PROXY) \
--build-arg https_proxy=$(PROXY) \
@ -114,7 +126,11 @@ ifeq ($(USE_PROXY), true)
--build-arg NO_PROXY=$(NO_PROXY) \
--build-arg ctx_base=$(BUILD_CTX) .
else
docker build --network host -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile \
docker build --network host -t $(IMAGE) \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(PYTHON_BASE_IMAGE) \
--build-arg ctx_base=$(BUILD_CTX) .
endif

7
images/airflow/Dockerfile

@ -16,6 +16,13 @@
ARG FROM=ubuntu:16.04
FROM ${FROM}
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-shipyard.readthedocs.org'
LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-shipyard'
LABEL org.opencontainers.image.vendor='The Airship Authors'
LABEL org.opencontainers.image.licenses='Apache-2.0'
# Do not prompt user for choices on installation/configuration of packages
# Set port 8080 for Airflow Web
# Set port 5555 for Airflow Flower

7
images/shipyard/Dockerfile

@ -15,6 +15,13 @@
ARG FROM=python:3.5
FROM ${FROM}
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-shipyard.readthedocs.org'
LABEL org.opencontainers.image.source='https://git.openstack.org/openstack/airship-shipyard'
LABEL org.opencontainers.image.vendor='The Airship Authors'
LABEL org.opencontainers.image.licenses='Apache-2.0'
ENV container docker
ENV PORT 9000
ENV LC_ALL C.UTF-8

1
tools/gate/roles/build-images/tasks/airship-shipyard.yaml

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

Loading…
Cancel
Save