Update Image build process
Adding variable to allow for modular build of ranger-agent image. Change-Id: I283932be11303cde9e1f8af0b489bb786e76fec0
This commit is contained in:
parent
67790d01fe
commit
9deb5946d3
@ -1,4 +1,5 @@
|
||||
FROM ubuntu:18.04
|
||||
ARG BASE_IMAGE=ubuntu:18.04
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV container docker
|
||||
|
4
Makefile
4
Makefile
@ -23,6 +23,7 @@ NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||
USE_PROXY ?= false
|
||||
RANGER_AGENT_USER := ranger_agent
|
||||
PUSH_IMAGE := false
|
||||
BASE_IMAGE ?= ubuntu:18.04
|
||||
|
||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${COMMIT}
|
||||
|
||||
@ -52,6 +53,7 @@ build_$(IMAGE_NAME):
|
||||
ifeq ($(USE_PROXY), true)
|
||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f Dockerfile \
|
||||
--build-arg user=$(RANGER_AGENT_USER) \
|
||||
--build-arg BASE_IMAGE=${BASE_IMAGE} \
|
||||
--build-arg http_proxy=$(PROXY) \
|
||||
--build-arg https_proxy=$(PROXY) \
|
||||
--build-arg HTTP_PROXY=$(PROXY) \
|
||||
@ -59,7 +61,7 @@ ifeq ($(USE_PROXY), true)
|
||||
--build-arg no_proxy=$(NO_PROXY) \
|
||||
--build-arg NO_PROXY=$(NO_PROXY) .
|
||||
else
|
||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f Dockerfile --build-arg user=$(RANGER_AGENT_USER) .
|
||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f Dockerfile --build-arg user=$(RANGER_AGENT_USER) --build-arg BASE_IMAGE=${BASE_IMAGE} .
|
||||
endif
|
||||
|
||||
ifeq ($(PUSH_IMAGE), true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user