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 IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache
BUILD_DIR := $(shell mktemp -d) BUILD_DIR := $(shell mktemp -d)
HELM := $(BUILD_DIR)/helm HELM := $(BUILD_DIR)/helm
SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/daily/"
.PHONY: images .PHONY: images
#Build all images in the list #Build all images in the list
@ -64,9 +65,9 @@ helm-install:
.PHONY: build .PHONY: build
build: build:
ifeq ($(USE_PROXY), true) 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 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 endif
ifeq ($(PUSH_IMAGE), true) ifeq ($(PUSH_IMAGE), true)
docker push $(IMAGE) docker push $(IMAGE)

View File

@ -1,6 +1,7 @@
FROM ubuntu:16.04 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 && \ RUN apt-get -qq update && \
apt install -y simplestreams \ apt install -y simplestreams \