summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Main <imain@redhat.com>2017-01-25 21:08:53 -0500
committerIan Main <imain@redhat.com>2017-02-24 16:49:20 +0000
commit28b908abfc09aabc4c3cc2dd48152c5b8d2bb0d3 (patch)
tree530f4b4df353185567e4e942ec7d9b80b0fee7af
parent1930d31d0e221cf6c3af09b51d38809fe75a8fb9 (diff)
Add option to diff containers after config stage.
This allows you to show the changes made to a container during configuration stage for fast development. Change-Id: Id9c72cf2b07486f0a80bf3572a7ba349888d877f
-rwxr-xr-xdocker/docker-puppet.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py
index 1bb8bc2b..86c8ec98 100755
--- a/docker/docker-puppet.py
+++ b/docker/docker-puppet.py
@@ -46,6 +46,15 @@ def pull_image(name):
def rm_container(name):
+ if os.environ.get('SHOW_DIFF', None):
+ print('Diffing container: %s' % name)
+ subproc = subprocess.Popen(['/usr/bin/docker', 'diff', name],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ cmd_stdout, cmd_stderr = subproc.communicate()
+ print(cmd_stdout)
+ print(cmd_stderr)
+
print('Removing container: %s' % name)
subproc = subprocess.Popen(['/usr/bin/docker', 'rm', name],
stdout=subprocess.PIPE,