diff DockerToolFactory.py @ 2:5b930e77b1f3

Better readability of Dockerfile, fix editing of userid for Dockerfile in DockerToolFactory.py.
author mvdbeek
date Wed, 03 Dec 2014 00:26:43 +0100
parents 5d70248d1e01
children de4889098f45
line wrap: on
line diff
--- a/DockerToolFactory.py	Tue Dec 02 19:45:07 2014 +0100
+++ b/DockerToolFactory.py	Wed Dec 03 00:26:43 2014 +0100
@@ -68,7 +68,7 @@
        otherwise we have a mismatch in the file permissions inside the container'''
     uid=os.getuid()
     for line in fileinput.FileInput(dockerfile, inplace=1):
-        sys.stdout.write(line.replace("RUN adduser galaxy\n",  "RUN adduser galaxy -u {0}\n".format(uid)))
+        sys.stdout.write(re.sub("RUN adduser galaxy.*",  "RUN adduser galaxy -u {0}\n".format(uid), line))
 
 def build_docker(dockerfile, docker_client, image_tag='base'):
     '''Given the path to a dockerfile, and a docker_client, build the image, if it does not