summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_create_test.go
diff options
context:
space:
mode:
authorLei Jitang <leijitang@huawei.com>2016-01-08 12:11:21 +0800
committerLei Jitang <leijitang@huawei.com>2016-01-08 12:11:21 +0800
commitcde0ed67a14e3983ba83af8c75434558c865b2bc (patch)
tree82f3933da2e4c3d8645b84c54aea1b58534ee6a2 /integration-cli/docker_cli_create_test.go
parentaf6c6dbf8748b0e09d48a788cb17cb6d3c30c7a4 (diff)
downloaddocker-cde0ed67a14e3983ba83af8c75434558c865b2bc.tar.gz
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>
Diffstat (limited to 'integration-cli/docker_cli_create_test.go')
-rw-r--r--integration-cli/docker_cli_create_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_create_test.go b/integration-cli/docker_cli_create_test.go
index bbd1eb6df1..fc7f9a42eb 100644
--- a/integration-cli/docker_cli_create_test.go
+++ b/integration-cli/docker_cli_create_test.go
@@ -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")
+}