Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docker cp should support VOLUMEs #1992

Description

@darklajid

docker cp seems to be limited to the root/default volume, as confirmed on IRC:

$ cat Dockerfile
FROM ubuntu:precise
MAINTAINER Benjamin Podszun "[email protected]"

VOLUME /some/volume
RUN touch /some/volume/I_Want_To_Copy_This

CMD /bin/bash

$ docker build .
Uploading context 10240 bytes
Step 1 : FROM ubuntu:precise
Pulling repository ubuntu
---> 8dbd9e392a96layersfrom ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/
Step 2 : MAINTAINER Benjamin Podszun "[email protected]"
---> Using cache
---> c950832bf997
Step 3 : VOLUME /some/volume
---> Running in f9b8fc1901f2
---> 56106cf843d5
Step 4 : RUN touch /some/volume/I_Want_To_Copy_This
---> Running in 31eca80e094d
---> 2cb2858fedee
Step 5 : CMD /bin/bash
---> Running in af26bafd07ba
---> 4e0f6538a826
Successfully built 4e0f6538a826

$ docker run -i -t 4e0f6538a826
root@d787a64f78f9:/#

$ docker cp d787a64f78f9:/some/volume/I_Want_To_Copy_This .
2013/09/24 17:12:11 Error: stat /var/lib/docker/containers/d787a64f78f94e88abcdda2c8224c3ecfface23d783c4308f08ef1a3367d2ae1/rootfs/some/volume/I_Want_To_Copy_This: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions