From 8adc845af51927ff0ead24d4027a803a5bc644d0 Mon Sep 17 00:00:00 2001 From: Stacey Fletcher Date: Fri, 15 Jun 2018 11:55:25 -0500 Subject: [PATCH] Add ARG to MAAS SimpleStream Dockerfile This allows the simplestream repo to be passed at build time. Change-Id: I7c854bd04366ec145f0ae5b7e3b166c2201ff740 --- Makefile | 5 +++-- images/sstream-cache/Dockerfile | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a76d705..0697ab9 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/images/sstream-cache/Dockerfile b/images/sstream-cache/Dockerfile index dbeba6e..d1f145a 100644 --- a/images/sstream-cache/Dockerfile +++ b/images/sstream-cache/Dockerfile @@ -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 \