Skip to content

Commit 1e51be6

Browse files
committed
Add WorkingDir to bridge the gap with Podman
1 parent b3dea2d commit 1e51be6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

repo2docker/docker.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,15 @@ def inspect_image(self, image):
201201
return None
202202

203203
config = json.loads(proc.stdout.decode())[0]
204-
return Image(tags=config["RepoTags"], config=config["Config"])
204+
tags = config["RepoTags"]
205+
oci_image_configuration = config["Config"]
206+
207+
# WorkingDir is optional but docker always include it.
208+
# https://github.com/containers/podman/discussions/27313
209+
if "WorkingDir" not in oci_image_configuration:
210+
oci_image_configuration["WorkingDir"] = ""
211+
212+
return Image(tags=config["RepoTags"], config=oci_image_configuration)
205213

206214
@contextmanager
207215
def docker_login(self, username, password, registry):

0 commit comments

Comments
 (0)