From 13084e640779acd1aa39e528c51761dc1c8d085f Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Mon, 28 Oct 2019 13:01:34 -0700 Subject: [PATCH] Add xenial-based calicoctl-utility containers The change adds new Dockerfiles to allow calicoctl-utility containers to be built using ubuntu_xenial as a base, for consistency with the rest of the utility containers. Change-Id: Ib7cbb159a22e1a38645b747ad94dd30ebb25757a --- .../Dockerfile.ubuntu_xenial | 44 ++++++++++++++++ ...Dockerfile_calicoq_calicoctl.ubuntu_xenial | 52 +++++++++++++++++++ images/calicoctl-utility/Makefile | 2 +- zuul.d/base.yaml | 3 ++ zuul.d/calicoctl-utility.yaml | 25 ++++++++- 5 files changed, 124 insertions(+), 2 deletions(-) create mode 100755 images/calicoctl-utility/Dockerfile.ubuntu_xenial create mode 100755 images/calicoctl-utility/Dockerfile_calicoq_calicoctl.ubuntu_xenial diff --git a/images/calicoctl-utility/Dockerfile.ubuntu_xenial b/images/calicoctl-utility/Dockerfile.ubuntu_xenial new file mode 100755 index 00000000..e8b7fd36 --- /dev/null +++ b/images/calicoctl-utility/Dockerfile.ubuntu_xenial @@ -0,0 +1,44 @@ +ARG FROM=docker.io/ubuntu:xenial +ARG DOCKER_REGISTRY=quay.io +ARG CALICOCTL_IMAGE_PREFIX=calico/ctl +ARG CALICOCTL_VERSION=v3.4.4 +ARG CALICOCTL_IMAGE="${DOCKER_REGISTRY}/${CALICOCTL_IMAGE_PREFIX}:${CALICOCTL_VERSION}" + +FROM ${CALICOCTL_IMAGE} as stage_calicoctl + +FROM ${FROM} + +ARG CALICOCTL_VERSION + +LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \ + org.opencontainers.image.url='https://airshipit.org' \ + org.opencontainers.image.documentation='https://opendev.org/airship/porthole' \ + org.opencontainers.image.source='https://opendev.org/airship/porthole' \ + org.opencontainers.image.vendor='The Airship Authors' \ + org.opencontainers.image.licenses='Apache-2.0' \ + org.projectcalico.calicoctl.version="${CALICOCTL_VERSION}" + +RUN set -xe \ + && sed -i '/nobody/d' /etc/passwd \ + && echo "nobody:x:65534:65534:nobody:/nonexistent:/bin/bash" >> /etc/passwd \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + bash \ + moreutils \ + sudo \ + rsyslog \ + python-oslo.rootwrap \ + python3-oslo.rootwrap \ + socat \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=stage_calicoctl /calicoctl /usr/local/bin/calicoctl + +RUN set -xe \ + && chmod 0754 /usr/local/bin/calicoctl \ + && chmod 0754 /usr/bin/socat + +WORKDIR /tmp + +CMD ["/bin/bash"] diff --git a/images/calicoctl-utility/Dockerfile_calicoq_calicoctl.ubuntu_xenial b/images/calicoctl-utility/Dockerfile_calicoq_calicoctl.ubuntu_xenial new file mode 100755 index 00000000..bed610bd --- /dev/null +++ b/images/calicoctl-utility/Dockerfile_calicoq_calicoctl.ubuntu_xenial @@ -0,0 +1,52 @@ +ARG FROM=docker.io/ubuntu:xenial +ARG DOCKER_REGISTRY=quay.io +ARG CALICOCTL_IMAGE_PREFIX=tigera/calicoctl +ARG CALICOCTL_VERSION=v2.3.1 +ARG CALICOCTL_IMAGE="${DOCKER_REGISTRY}/${CALICOCTL_IMAGE_PREFIX}:${CALICOCTL_VERSION}" +ARG CALICOQ_IMAGE_PREFIX=tigera/calicoq +ARG CALICOQ_VERSION=v2.3.1 +ARG CALICOQ_IMAGE="${DOCKER_REGISTRY}/${CALICOQ_IMAGE_PREFIX}:${CALICOQ_VERSION}" + +FROM ${CALICOCTL_IMAGE} as stage_calicoctl +FROM ${CALICOQ_IMAGE} as stage_calicoq + +FROM ${FROM} + +ARG CALICOCTL_VERSION +ARG CALICOQ_VERSION + +LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \ + org.opencontainers.image.url='https://airshipit.org' \ + org.opencontainers.image.documentation='https://opendev.org/airship/porthole' \ + org.opencontainers.image.source='https://opendev.org/airship/porthole' \ + org.opencontainers.image.vendor='The Airship Authors' \ + org.opencontainers.image.licenses='Apache-2.0' \ + io.tigera.calicoctl.version="${CALICOCTL_VERSION}" \ + io.tigera.calicoq.version="${CALICOQ_VERSION}" + +RUN set -xe \ + && sed -i '/nobody/d' /etc/passwd \ + && echo "nobody:x:65534:65534:nobody:/nonexistent:/bin/bash" >> /etc/passwd \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + bash \ + moreutils \ + sudo \ + rsyslog \ + python-oslo.rootwrap \ + python3-oslo.rootwrap \ + socat \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=stage_calicoctl /calicoctl /usr/local/bin/calicoctl +COPY --from=stage_calicoq /calicoq /usr/local/bin/calicoq + +RUN set -xe \ + && chmod 0754 /usr/local/bin/calicoctl \ + && chmod 0754 /usr/local/bin/calicoq \ + && chmod 0754 /usr/bin/socat + +WORKDIR /tmp + +CMD ["/bin/bash"] diff --git a/images/calicoctl-utility/Makefile b/images/calicoctl-utility/Makefile index 5de287bf..9440248e 100644 --- a/images/calicoctl-utility/Makefile +++ b/images/calicoctl-utility/Makefile @@ -31,7 +31,7 @@ images: build_$(IMAGE_NAME) .PHONY: build_$(IMAGE_NAME) build_$(IMAGE_NAME): ifeq ($(BUILD_TYPE), community) - docker build -f Dockerfile_calicoctl_only.$(OS_RELEASE) \ + docker build -f Dockerfile.$(OS_RELEASE) \ --network host \ $(EXTRA_BUILD_ARGS) \ -t $(IMAGE) \ diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index afc734ad..382c1179 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -17,6 +17,7 @@ jobs: - airship-porthole-linter - airship-porthole-images-build-gate-calicoctl-utility + - airship-porthole-images-build-gate-calicoctl-utility-ubuntu_xenial - airship-porthole-images-build-gate-ceph-utility - airship-porthole-images-build-gate-compute-utility - airship-porthole-images-build-gate-etcdctl-utility @@ -27,6 +28,7 @@ jobs: - airship-porthole-linter - airship-porthole-images-build-gate-calicoctl-utility + - airship-porthole-images-build-gate-calicoctl-utility-ubuntu_xenial - airship-porthole-images-build-gate-ceph-utility - airship-porthole-images-build-gate-compute-utility - airship-porthole-images-build-gate-etcdctl-utility @@ -37,6 +39,7 @@ post: jobs: - airship-porthole-images-publish-calicoctl-utility + - airship-porthole-images-publish-calicoctl-utility-ubuntu_xenial - airship-porthole-images-publish-ceph-utility - airship-porthole-images-publish-compute-utility - airship-porthole-images-publish-etcdctl-utility diff --git a/zuul.d/calicoctl-utility.yaml b/zuul.d/calicoctl-utility.yaml index 57592ecb..9a5d6fe7 100644 --- a/zuul.d/calicoctl-utility.yaml +++ b/zuul.d/calicoctl-utility.yaml @@ -18,13 +18,21 @@ vars: image_name: &image_name porthole-calicoctl-utility distro_suffix: &distro_suffix alpine - files: + files: &files - ^charts/calicoctl-utility/.*$ - ^images/calicoctl-utility/.*$ - ^Makefile$ - ^tools/.*$ - ^zuul.d/.*$ +- job: + name: airship-porthole-images-build-gate-calicoctl-utility-ubuntu_xenial + parent: *parent + vars: + image_name: *image_name + distro_suffix: ubuntu_xenial + files: *files + - job: name: airship-porthole-images-publish-calicoctl-utility parent: *parent @@ -39,3 +47,18 @@ tags: dynamic: commit: true + +- job: + name: airship-porthole-images-publish-calicoctl-utility-ubuntu_xenial + parent: *parent + secrets: + - name: quay_credentials + secret: quay_credentials + pass-to-parent: true + vars: + image_name: *image_name + distro_suffix: ubuntu_xenial + publish: true + tags: + dynamic: + commit: true