Mercurial > repos > mvdbeek > docker_toolfactory_alpha
comparison DockerToolFactory.py @ 1:5d70248d1e01
Fix image tag in call to docker build process.
| author | mvdbeek |
|---|---|
| date | Tue, 02 Dec 2014 19:45:07 +0100 |
| parents | 7e0392d4531c |
| children | 5b930e77b1f3 |
comparison
equal
deleted
inserted
replaced
| 0:7e0392d4531c | 1:5d70248d1e01 |
|---|---|
| 77 existing_images=", ".join(["".join(d['RepoTags']) for d in docker_client.images()]) | 77 existing_images=", ".join(["".join(d['RepoTags']) for d in docker_client.images()]) |
| 78 if image_id in existing_images: | 78 if image_id in existing_images: |
| 79 print 'docker container exists, skipping build' | 79 print 'docker container exists, skipping build' |
| 80 return image_id | 80 return image_id |
| 81 print "Building Docker image, using Dockerfile:{0}".format(dockerfile) | 81 print "Building Docker image, using Dockerfile:{0}".format(dockerfile) |
| 82 build_process=docker_client.build(fileobj=open(dockerfile, 'r'), image_tag=image_id) | 82 build_process=docker_client.build(fileobj=open(dockerfile, 'r'), tag=image_id) |
| 83 print "succesfully dispatched docker build process, building now" | 83 print "succesfully dispatched docker build process, building now" |
| 84 build_log=[line for line in build_process] #will block until image is built. | 84 build_log=[line for line in build_process] #will block until image is built. |
| 85 return image_id | 85 return image_id |
| 86 | 86 |
| 87 def construct_bind(host_path, container_path=False, binds=None, ro=True): | 87 def construct_bind(host_path, container_path=False, binds=None, ro=True): |
