diff --git a/.env b/.env.sample similarity index 89% rename from .env rename to .env.sample index a161f0f..2dc34b3 100644 --- a/.env +++ b/.env.sample @@ -1,3 +1,5 @@ REGISTRY_URL=docker.registry IMAGE_NAME=packer-builder VERSION=1.0.0 +PROXY= + diff --git a/.gitignore b/.gitignore index 2f41577..d599a62 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.iso *.tar *.bz2 +.env packer/assets/id_rsa_qemu* packer/assets/packer_cache/ diff --git a/docker-compose.yml b/docker-compose.yml index cc57c27..dce2eee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: image: ${REGISTRY_URL}/${IMAGE_NAME}:${VERSION} build: context: ./packer + args: + PROXY: "${PROXY}" entrypoint: "bash -c" command: "'while sleep 3600; do :; done'" stdin_open: true diff --git a/packer/Dockerfile b/packer/Dockerfile index 4e40b27..18b842c 100644 --- a/packer/Dockerfile +++ b/packer/Dockerfile @@ -1,5 +1,9 @@ FROM hashicorp/packer:1.5.1 +ARG PROXY="" +ENV http_proxy="${PROXY}" +ENV https_proxy="${PROXY}" + ARG USER=packer ARG GROUP=packer