Fix issue with concurrent builds
+import uuid
+
import jinja2
import json
import logging
@@ -33,6 +35,8 @@ class BaseDockerBuilder(object):
build_steps=None,
env_vars=None,
dockerfile_name='Dockerfile'):
+ # This will help create a unique tmp folder for dockerizer in case of concurrent jobs
+ self.uuid = uuid.uuid4().hex
self.from_image = from_image
self.image_name = image_name
self.image_tag = image_tag
@@ -60,7 +64,8 @@ class BaseDockerBuilder(object):
def create_tmp_repo(self):
# Create a tmp copy of the repo before starting the build
- return copy_to_tmp_dir(self.repo_path, os.path.join(self.image_tag, self.folder_name))
+ return copy_to_tmp_dir(path=self.repo_path,
+ dir_name=os.path.join(self.uuid, self.image_tag, self.folder_name))
def check_image(self):
return self.docker.images(self.get_tagged_image())
