See:
http://stackoverflow.com/questions/32044399/ansible-docker-module-missing-cp-command
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
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.
the docker connection plugin should be able to copy, still a PR to be
merged, but might be worth a look.