Skip to content

Commit 80d186a

Browse files
authored
Merge pull request #1413 from yuvipanda/push
Simulate json output from docker buildx build
2 parents 13cbc9e + b6fa2d4 commit 80d186a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

repo2docker/docker.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DockerEngine(ContainerEngine):
5858
https://docker-py.readthedocs.io/en/4.2.0/api.html#module-docker.api.build
5959
"""
6060

61-
string_output = True
61+
string_output = False
6262

6363
extra_init_args = Dict(
6464
{},
@@ -141,12 +141,18 @@ def build(
141141

142142
args += [d]
143143

144-
yield from execute_cmd(args, True)
144+
for line in execute_cmd(args, True):
145+
# Simulate structured JSON output from buildx build, since we
146+
# do get structured json output from pushing and running
147+
yield {"stream": line}
145148
else:
146149
# Assume 'path' is passed in
147150
args += [path]
148151

149-
yield from execute_cmd(args, True)
152+
for line in execute_cmd(args, True):
153+
# Simulate structured JSON output from buildx build, since we
154+
# do get structured json output from pushing and running
155+
yield {"stream": line}
150156

151157
def images(self):
152158
images = self._apiclient.images()

0 commit comments

Comments
 (0)