Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Use BuildKit for all images #229

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ue4docker/infrastructure/ImageBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
"""
Expand Down