Ansible docker module missing CP command? Ansible docker module missing CP command? docker docker

Ansible docker module missing CP command?


  1. You didn't. Ansible's docker module does not support copying files or folders from a container.
  2. 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.

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.


Using ansible shell module helped:

  - name: copy db dump to localhost    ansible.builtin.shell: docker cp container:/tmp/dump.sql /tmp/dump.sql