Ansible docker module missing CP command?

334 views
Skip to first unread message

Hristo Stoyanov

unread,
Aug 17, 2015, 3:13:09 AM8/17/15
to Ansible Project

Igor Homyakov

unread,
Aug 17, 2015, 7:56:57 AM8/17/15
to ansible...@googlegroups.com
Hi Hristo,

You didn't. Docker module does not support copying files or folders
from a container.

There is no simple way to do so. I mean you need a hack. Off the top
of my head you can play with '-' argument for docker cp option. But it
will break idempotency for sure.

However from my point of view if you wish to copy something into a
container you're probably doing something wrong. Containers should be
ephemeral. https://docs.docker.com/articles/dockerfile_best-practices/

-- Best, Igor

On Mon, Aug 17, 2015 at 10:13 AM, Hristo Stoyanov <hr.st...@gmail.com> wrote:
> See:
> http://stackoverflow.com/questions/32044399/ansible-docker-module-missing-cp-command
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/41a9508a-ca90-4e6e-9461-84b56c6f3bdc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hristo Stoyanov

unread,
Aug 17, 2015, 2:05:58 PM8/17/15
to Ansible Project
Igor,
Not sure why you think ephemeral containers contradicts the need for copying files in and out of the container. In fact, there lots of good reason to do that, which is why docker client supports CP command, and expanded it in 1.8

In the stackoverflow thread someone suggested "synchronize" module, and then run the native local "docker cp ..." In the host, as a workaround.

Brian Coca

unread,
Aug 17, 2015, 5:05:18 PM8/17/15
to Ansible Project
the docker connection plugin should be able to copy, still a PR to be
merged, but might be worth a look.
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2d2b5979-de8a-471e-8e3b-18a958dc7968%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages