Create simplestreams cache image

- Create image with simplestreams package
- Mirror current upstream maas.io xenial images
- Run apache on port 8888 to serve the simplestreams repo

Change-Id: I121d62894464ae62a2a59bd62a2448835a1f67af
This commit is contained in:
Scott Hussey 2017-11-29 16:03:46 -06:00
parent 840075ca88
commit d3b4cc974f
2 changed files with 40 additions and 1 deletions

View File

@ -17,6 +17,8 @@ REGION_SUFFIX ?= regiond
REGION_IMG_DIR ?= images/maas-region-controller REGION_IMG_DIR ?= images/maas-region-controller
RACK_SUFFIX ?= rackd RACK_SUFFIX ?= rackd
RACK_IMG_DIR ?= images/maas-rack-controller RACK_IMG_DIR ?= images/maas-rack-controller
CACHE_SUFFIX ?= cache
CACHE_IMG_DIR ?= images/sstream-cache
IMAGE_PREFIX ?= attcomdev IMAGE_PREFIX ?= attcomdev
IMAGE_TAG ?= latest IMAGE_TAG ?= latest
HELM ?= helm HELM ?= helm
@ -25,7 +27,7 @@ USE_PROXY ?= false
# Build all docker images for this project # Build all docker images for this project
.PHONY: images .PHONY: images
images: build_rack build_region images: build_rack build_region build_cache
# Create tgz of the chart # Create tgz of the chart
.PHONY: charts .PHONY: charts
@ -61,6 +63,14 @@ else
docker build -t $(IMAGE_PREFIX)/$(MAAS_IMAGE_COMMON)-$(REGION_SUFFIX):$(IMAGE_TAG) -f $(REGION_IMG_DIR)/Dockerfile $(REGION_IMG_DIR) docker build -t $(IMAGE_PREFIX)/$(MAAS_IMAGE_COMMON)-$(REGION_SUFFIX):$(IMAGE_TAG) -f $(REGION_IMG_DIR)/Dockerfile $(REGION_IMG_DIR)
endif endif
.PHONY: build_cache
build_cache:
ifeq ($(USE_PROXY), true)
docker build -t $(IMAGE_PREFIX)/$(MAAS_IMAGE_COMMON)-$(CACHE_SUFFIX):$(IMAGE_TAG) -f $(CACHE_IMG_DIR)/Dockerfile $(CACHE_IMG_DIR) --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY)
else
docker build -t $(IMAGE_PREFIX)/$(MAAS_IMAGE_COMMON)-$(CACHE_SUFFIX):$(IMAGE_TAG) -f $(CACHE_IMG_DIR)/Dockerfile $(CACHE_IMG_DIR)
endif
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf build rm -rf build

View File

@ -0,0 +1,29 @@
FROM ubuntu:16.04
ENV IMAGE_SRC https://images.maas.io/ephemeral-v3/daily/
RUN apt-get -qq update && \
apt install -y simplestreams \
apache2 \
gpgv \
ubuntu-cloudimage-keyring \
python-certifi --no-install-recommends
RUN sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg $IMAGE_SRC \
/var/www/html/maas/images/ephemeral-v3/daily 'arch=amd64' 'release~xenial' --max=1 --progress
RUN sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg $IMAGE_SRC \
/var/www/html/maas/images/ephemeral-v3/daily 'os~(grub*|pxelinux)' --max=1 --progress
RUN sh -c 'echo "" > /etc/apache2/ports.conf'
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/
ENV APACHE_LOCK_DIR /var/lock
ENV APACHE_LOG_DIR /var/log/
ENV LANG C
ENTRYPOINT ["/usr/sbin/apache2"]
CMD ["-E", "/dev/stderr","-c","ErrorLog /dev/stderr","-c","Listen 8888","-c","ServerRoot /etc/apache2","-c","DocumentRoot /var/www/html","-D","FOREGROUND"]