mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Fix copy from a "created" container. Fixes #14420
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
@@ -632,3 +632,20 @@ func (s *DockerSuite) TestCopyAndRestart(c *check.C) {
|
||||
c.Fatalf("expected %q but got %q", expectedMsg, msg)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestCopyCreatedContainer(c *check.C) {
|
||||
out, err := exec.Command(dockerBinary, "create", "--name", "test_cp", "-v", "/test", "busybox").CombinedOutput()
|
||||
if err != nil {
|
||||
c.Fatalf(string(out), err)
|
||||
}
|
||||
|
||||
tmpDir, err := ioutil.TempDir("", "test")
|
||||
if err != nil {
|
||||
c.Fatalf("unable to make temporary directory: %s", err)
|
||||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
out, err = exec.Command(dockerBinary, "cp", "test_cp:/bin/sh", tmpDir).CombinedOutput()
|
||||
if err != nil {
|
||||
c.Fatalf(string(out), err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user