Minimise docker layers

This commit is contained in:
Simon Bruder 2019-11-01 16:28:18 +00:00 committed by Jakob Lechner
parent 3e89556ae6
commit aedcc9d9bc
6 changed files with 61 additions and 90 deletions

View file

@ -58,29 +58,28 @@ images/debian-buster.squashfs: images
docker run \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "${PWD}/packer:/workdir" \
-v "${PWD}/aria2c:/workdir/aria2c" \
-v "${PWD}/images:/images" \
-e "user=`id -u`" \
-e "group=`id -g`" \
-v "${PWD}:${PWD}" \
-w "${PWD}" \
-u `id -u`:`id -g` \
-e "IMAGES=${PWD}/images" \
-e "ANNOUNCE=$(ANNOUNCE)" \
-e "WEBSEED=$(WEBSEED)" \
-e "COMPRESSION_LEVEL=$(COMPRESSION_LEVEL)" \
$(ci_environment) \
"$(DOCKER_IMAGE_BUILDER)" \
scripts/packer.sh \
debian-buster
images/debian-buster.torrent: images
docker run \
--rm \
-v "${PWD}/images:/images" \
-e "user=`id -u`" \
-e "group=`id -g`" \
-v "${PWD}:${PWD}" \
-w "${PWD}" \
-u `id -u`:`id -g` \
-e "ANNOUNCE=$(ANNOUNCE)" \
-e "WEBSEED=$(WEBSEED)" \
-e "TASK=torrent" \
"$(DOCKER_IMAGE_BUILDER)" \
scripts/torrent.sh \
debian-buster
.PHONY: ansible
@ -88,14 +87,14 @@ ansible:
docker run \
--rm \
-v "${PWD}/packer/ansible:/ansible" \
-e "user=`id -u`" \
-e "group=`id -g`" \
-u `id -u`:`id -g` \
-e "ANNOUNCE=$(ANNOUNCE)" \
-e "WEBSEED=$(WEBSEED)" \
-e "TASK=ansible" \
-v "${SSH_AUTH_SOCK}:/var/run/ssh_auth_sock" \
-e "SSH_AUTH_SOCK=/var/run/ssh_auth_sock" \
-w /ansible \
"$(DOCKER_IMAGE_BUILDER)" \
/usr/bin/ansible-playbook \
-i inventories \
$(if $(ANSIBLE_TAGS),-t $(ANSIBLE_TAGS),) \
-l $(ANSIBLE_LIMIT) \