Skip to content

Commit

Permalink
Add extra_buildx_build_args
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Jan 29, 2025
1 parent a03bf74 commit d940706
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion repo2docker/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile

from iso8601 import parse_date
from traitlets import Dict
from traitlets import Dict, List, Unicode

import docker

Expand Down Expand Up @@ -74,6 +74,15 @@ class DockerEngine(ContainerEngine):
config=True,
)

extra_buildx_build_args = List(
Unicode,
[],
help="""
Extra commandline arguments to pass to `docker buildx build` when building the image.
""",
help=True
)

def __init__(self, *, parent):
super().__init__(parent=parent)
try:
Expand Down Expand Up @@ -123,6 +132,9 @@ def build(
if platform:
args += ["--platform", platform]

# place extra args right *before* the path
args += self.extra_buildx_build_args

if fileobj:
with tempfile.TemporaryDirectory() as d:
tarf = tarfile.open(fileobj=fileobj)
Expand Down

0 comments on commit d940706

Please sign in to comment.