Add ARG to MAAS SimpleStream Dockerfile

This allows the simplestream repo to be passed at build time.

Change-Id: I7c854bd04366ec145f0ae5b7e3b166c2201ff740
This commit is contained in:
Stacey Fletcher 2018-06-15 11:55:25 -05:00
parent 8805637db5
commit 8adc845af5
2 changed files with 5 additions and 3 deletions

View File

@ -29,6 +29,7 @@ LABEL ?= commit-id
IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache
BUILD_DIR := $(shell mktemp -d)
HELM := $(BUILD_DIR)/helm
SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/daily/"
.PHONY: images
#Build all images in the list
@ -64,9 +65,9 @@ helm-install:
.PHONY: build
build:
ifeq ($(USE_PROXY), true)
docker build -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY) $(IMAGE_DIR)
docker build -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY) $(IMAGE_DIR)
else
docker build -t $(IMAGE) --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile $(IMAGE_DIR)
docker build -t $(IMAGE) --label $(LABEL) --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) -f $(IMAGE_DIR)/Dockerfile $(IMAGE_DIR)
endif
ifeq ($(PUSH_IMAGE), true)
docker push $(IMAGE)

View File

@ -1,6 +1,7 @@
FROM ubuntu:16.04
ENV IMAGE_SRC https://images.maas.io/ephemeral-v3/daily/
ARG SSTREAM_IMAGE=https://images.maas.io/ephemeral-v3/daily/
ENV IMAGE_SRC ${SSTREAM_IMAGE}
RUN apt-get -qq update && \
apt install -y simplestreams \