summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2017-03-01 14:27:57 +0100
committerFlavio Percoco <flaper87@gmail.com>2017-03-01 15:16:30 +0100
commit3cba27131a6cd5362d35bc0268b2a6ccd29f3e41 (patch)
treef4c3923c107d761657769297ccaa6819aec534e5
parentde1637bdd1f7753f8a20469697f98ef3ddaf4e2b (diff)
Pass the DOCKER_* env vars when running docker
We should always pass the `DOCKER_*` env vars to all the `docker` commands that are executed in the various scripts as those variables may contain the access data for the docker daemon. Change-Id: Ie719f451350e6ea35cb22d97a8f090ad81fa8141
-rwxr-xr-xdocker/docker-puppet.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py
index d9496af6..6cee68fb 100755
--- a/docker/docker-puppet.py
+++ b/docker/docker-puppet.py
@@ -207,6 +207,11 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
dcmd.extend(['--entrypoint', sh_script])
env = {}
+ # NOTE(flaper87): Always copy the DOCKER_* environment variables as
+ # they contain the access data for the docker daemon.
+ for k in filter(lambda k: k.startswith('DOCKER'), os.environ.keys()):
+ env[k] = os.environ.get(k)
+
if os.environ.get('NET_HOST', 'false') == 'true':
print('NET_HOST enabled')
dcmd.extend(['--net', 'host', '--volume',