Skip to content

Commit d940706

Browse files
committed
Add extra_buildx_build_args
1 parent a03bf74 commit d940706

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

repo2docker/docker.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import tempfile
88

99
from iso8601 import parse_date
10-
from traitlets import Dict
10+
from traitlets import Dict, List, Unicode
1111

1212
import docker
1313

@@ -74,6 +74,15 @@ class DockerEngine(ContainerEngine):
7474
config=True,
7575
)
7676

77+
extra_buildx_build_args = List(
78+
Unicode,
79+
[],
80+
help="""
81+
Extra commandline arguments to pass to `docker buildx build` when building the image.
82+
""",
83+
help=True
84+
)
85+
7786
def __init__(self, *, parent):
7887
super().__init__(parent=parent)
7988
try:
@@ -123,6 +132,9 @@ def build(
123132
if platform:
124133
args += ["--platform", platform]
125134

135+
# place extra args right *before* the path
136+
args += self.extra_buildx_build_args
137+
126138
if fileobj:
127139
with tempfile.TemporaryDirectory() as d:
128140
tarf = tarfile.open(fileobj=fileobj)

0 commit comments

Comments
 (0)