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
This commit is contained in:
parent
ebe95d1875
commit
ac997fd6ec
29
Makefile
29
Makefile
@ -12,21 +12,22 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build)
|
||||
DOCKER_REGISTRY ?= quay.io
|
||||
IMAGE_NAME ?= drydock
|
||||
IMAGE_PREFIX ?= airshipit
|
||||
IMAGE_TAG ?= dev
|
||||
HELM := $(shell realpath $(BUILD_DIR))/helm
|
||||
PROXY ?= http://proxy.foo.com:8000
|
||||
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||
USE_PROXY ?= false
|
||||
PUSH_IMAGE ?= false
|
||||
BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build)
|
||||
DOCKER_REGISTRY ?= quay.io
|
||||
IMAGE_NAME ?= drydock
|
||||
IMAGE_PREFIX ?= airshipit
|
||||
IMAGE_TAG ?= dev
|
||||
HELM := $(shell realpath $(BUILD_DIR))/helm
|
||||
UBUNTU_BASE_IMAGE ?=
|
||||
PROXY ?= http://proxy.foo.com:8000
|
||||
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||
USE_PROXY ?= false
|
||||
PUSH_IMAGE ?= false
|
||||
# use this variable for image labels added in internal build process
|
||||
LABEL ?= org.airshipit.build=community
|
||||
COMMIT ?= $(shell git rev-parse HEAD)
|
||||
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||
GO_BUILDER ?= docker.io/golang:1.10-stretch
|
||||
LABEL ?= org.airshipit.build=community
|
||||
COMMIT ?= $(shell git rev-parse HEAD)
|
||||
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||
GO_BUILDER ?= docker.io/golang:1.10-stretch
|
||||
|
||||
export
|
||||
|
||||
|
@ -11,7 +11,9 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
FROM ubuntu:16.04
|
||||
|
||||
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'
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
UBUNTU_BASE_IMAGE=${UBUNTU_BASE_IMAGE:-""}
|
||||
UBUNTU_REPO=${UBUNTU_REPO:-""}
|
||||
TRUSTED_UBUNTU_REPO=${TRUSTED_UBUNTU_REPO:-"no"}
|
||||
ALLOW_UNATHENTICATED=${ALLOW_UNAUTHENTICATED:-"false"}
|
||||
@ -9,6 +10,11 @@ PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST:-""}
|
||||
|
||||
ADDL_BUILD_ARGS=""
|
||||
|
||||
if [[ ! -z "${UBUNTU_BASE_IMAGE}" ]]
|
||||
then
|
||||
ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS} --build-arg FROM=${UBUNTU_BASE_IMAGE}"
|
||||
fi
|
||||
|
||||
if [[ ! -z "${UBUNTU_REPO}" ]]
|
||||
then
|
||||
ADDL_BUILD_ARGS="${ADDL_BUILD_ARGS} --build-arg UBUNTU_REPO=${UBUNTU_REPO}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user