Skip to content

docker exec should use working directory of container image by default #8166

@hickeng

Description

@hickeng

Story
As a user of VCH containers I expect consistent behaviour with regular docker.

Detail
docker exec was updated to use the container image working directory as part of the shift to containerd (see moby/moby@ddae20c#diff-3ed197c0a6f7a9ca73a3ee424e448ac1R222).

We should adopt this behaviour for consistency with base docker, but should do so at the same time as adding support for the exec -w option to explicitly set the working directory so that there is an easy path for restoring old behaviour.

This is not target at a patch release as it's a breaking behaviour.

Workaround
It's not a great workaround, but it's the same approach as was needed before docker changed the behaviour:

sh -c "cd /desired/dir && command-to-run"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions