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