summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Walters <drewwalters96@gmail.com>2019-03-06 13:05:28 -0600
committerDrew Walters <drewwalters96@gmail.com>2019-03-07 12:09:52 -0600
commitac997fd6ec18ad5b0cfb2849a5bd644c8db1eca8 (patch)
tree80f6c15ddad7d11c6d9b523af9aa8f4d20359031
parentebe95d18756f1e35a0e36c18078a07b823b861f0 (diff)
images: Allow base image substitution for Drydock
Currently, Drydock images are built using the Ubuntu:16.04 base image. This change allows users to specify different base images using the UBUNTU_BASE_IMAGE build argument. Change-Id: I9ddaa89eb5262571703a3dbf7ebb6deed1505842
Notes
Notes (review): Code-Review+1: Michael Beaver <michaelbeaver64@gmail.com> Code-Review+1: Nishant Kumar <nishant.e.kumar@ericsson.com> Code-Review+1: Vladyslav Drok <vdrok@mirantis.com> Code-Review+1: Dan Crank <dan.no@att.com> Code-Review+1: Rick Bartra <rb560u@att.com> Code-Review+2: Sean Eagan <sean.eagan@att.com> Code-Review+2: Scott Hussey <sthussey@att.com> Workflow+1: Scott Hussey <sthussey@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 07 Mar 2019 22:29:46 +0000 Reviewed-on: https://review.openstack.org/641472 Project: openstack/airship-drydock Branch: refs/heads/master
-rw-r--r--Makefile29
-rw-r--r--images/drydock/Dockerfile4
-rwxr-xr-xtools/drydock_image_build.sh6
3 files changed, 24 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index cf9eaf3..7401541 100644
--- a/Makefile
+++ b/Makefile
@@ -12,21 +12,22 @@
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14 14
15BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build) 15BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build)
16DOCKER_REGISTRY ?= quay.io 16DOCKER_REGISTRY ?= quay.io
17IMAGE_NAME ?= drydock 17IMAGE_NAME ?= drydock
18IMAGE_PREFIX ?= airshipit 18IMAGE_PREFIX ?= airshipit
19IMAGE_TAG ?= dev 19IMAGE_TAG ?= dev
20HELM := $(shell realpath $(BUILD_DIR))/helm 20HELM := $(shell realpath $(BUILD_DIR))/helm
21PROXY ?= http://proxy.foo.com:8000 21UBUNTU_BASE_IMAGE ?=
22NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local 22PROXY ?= http://proxy.foo.com:8000
23USE_PROXY ?= false 23NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
24PUSH_IMAGE ?= false 24USE_PROXY ?= false
25PUSH_IMAGE ?= false
25# use this variable for image labels added in internal build process 26# use this variable for image labels added in internal build process
26LABEL ?= org.airshipit.build=community 27LABEL ?= org.airshipit.build=community
27COMMIT ?= $(shell git rev-parse HEAD) 28COMMIT ?= $(shell git rev-parse HEAD)
28IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} 29IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
29GO_BUILDER ?= docker.io/golang:1.10-stretch 30GO_BUILDER ?= docker.io/golang:1.10-stretch
30 31
31export 32export
32 33
diff --git a/images/drydock/Dockerfile b/images/drydock/Dockerfile
index 7378bb2..50e1eab 100644
--- a/images/drydock/Dockerfile
+++ b/images/drydock/Dockerfile
@@ -11,7 +11,9 @@
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14FROM ubuntu:16.04 14
15ARG FROM=ubuntu:16.04
16FROM ${FROM}
15 17
16LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' 18LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode'
17LABEL org.opencontainers.image.url='https://airshipit.org' 19LABEL org.opencontainers.image.url='https://airshipit.org'
diff --git a/tools/drydock_image_build.sh b/tools/drydock_image_build.sh
index e0e585a..18d0906 100755
--- a/tools/drydock_image_build.sh
+++ b/tools/drydock_image_build.sh
@@ -1,6 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2set -x 2set -x
3 3
4UBUNTU_BASE_IMAGE=${UBUNTU_BASE_IMAGE:-""}
4UBUNTU_REPO=${UBUNTU_REPO:-""} 5UBUNTU_REPO=${UBUNTU_REPO:-""}
5TRUSTED_UBUNTU_REPO=${TRUSTED_UBUNTU_REPO:-"no"} 6TRUSTED_UBUNTU_REPO=${TRUSTED_UBUNTU_REPO:-"no"}
6ALLOW_UNATHENTICATED=${ALLOW_UNAUTHENTICATED:-"false"} 7ALLOW_UNATHENTICATED=${ALLOW_UNAUTHENTICATED:-"false"}
@@ -9,6 +10,11 @@ PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST:-""}
9 10
10ADDL_BUILD_ARGS="" 11ADDL_BUILD_ARGS=""
11 12
13if [[ ! -z "${UBUNTU_BASE_IMAGE}" ]]
14then
15 ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS} --build-arg FROM=${UBUNTU_BASE_IMAGE}"
16fi
17
12if [[ ! -z "${UBUNTU_REPO}" ]] 18if [[ ! -z "${UBUNTU_REPO}" ]]
13then 19then
14 ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS} --build-arg UBUNTU_REPO=${UBUNTU_REPO}" 20 ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS} --build-arg UBUNTU_REPO=${UBUNTU_REPO}"