diff --git a/ue4docker/infrastructure/ImageBuilder.py b/ue4docker/infrastructure/ImageBuilder.py index 1253cf50..a7534e1b 100644 --- a/ue4docker/infrastructure/ImageBuilder.py +++ b/ue4docker/infrastructure/ImageBuilder.py @@ -71,7 +71,7 @@ def build(self, name, tags, args, secrets=None): # Determine whether we are building using `docker buildx` with build secrets imageTags = self._formatTags(name, tags) command = DockerUtils.build(imageTags, self.context(name), args) - env = None + if self.platform == "linux" and secrets is not None and len(secrets) > 0: # Create temporary files to store the contents of each of our secrets @@ -85,10 +85,16 @@ def build(self, name, tags, args, secrets=None): command = DockerUtils.buildx( imageTags, self.context(name), args, secretFlags ) - env = {"DOCKER_BUILDKIT": "1"} # Build the image if it doesn't already exist - self._processImage(imageTags[0], name, command, "build", "built", env=env) + self._processImage( + imageTags[0], + name, + command, + "build", + "built", + env={"DOCKER_BUILDKIT": "1"}, + ) def context(self, name): """