1
0
mirror of https://github.com/moby/moby.git synced 2025-07-29 07:21:35 +03:00

Create the working directory on container creation

if create a container with -w to specify the working directory and
the directory does not exist in the container rootfs, the directory
will be created until the container start. It make docker export of
a created container and a running container inconsistent.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei Jitang
2016-01-08 12:11:21 +08:00
parent af6c6dbf87
commit cde0ed67a1
3 changed files with 14 additions and 2 deletions

View File

@ -415,3 +415,11 @@ func (s *DockerSuite) TestCreateStopSignal(c *check.C) {
c.Assert(res, checker.Contains, "9")
}
func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) {
testRequires(c, DaemonIsLinux)
name := "foo"
dir := "/home/foo/bar"
dockerCmd(c, "create", "--name", name, "-w", dir, "busybox")
dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), "/tmp")
}