Hello,
I am trying to implement docker in my workplace and plan on using Ansible to orchestrate my containers on my hosts. I have a few questions:
Is it possible to get the documentation the docker module page fleshed out a bit more? it’s a very capable module but a lot of the parameters have no examples and when combined with Docker can create some real confusion, such as…
Volumes. I would like to figure out what this volume module is actually capable of and I haven’t found any clear information. Is this for mounting volumes from the container onto the host? Vice versa? Bi-directional? I can’t seem to make any of them work, I just end up with empty directories that aren’t symlinks.
Syntax (tried both directions):
volumes:
- /foo/conf/ejabberd/lars:/lars
When I destroy a container that has storage volumes assigned to it, does Ansible automatically try to destroy the storage volumes? If the answer is “yes” then that’s scary, because those volumes are supposed to persist. If the answer is “no” then that’s scary too because we’ll end up with lots of storage volumes on the host. I didn’t see an option to delete the storage volume in ansible.
What exactly do the state parameter options even mean?
What is are the exact definitions of stopped, absent and killed? Absent and killed sound identical (end result is that it’s not there), so which do I use?
How do I just ensure that a container is present but stopped? Would I refer to it by it’s given name or by the image name or…? Example:
If I deploy a container from an image (foo.com:5000/nginx:1.1) and give it the name “bob”, would I be able to later say “Ok I want Bob to be stopped now”? I have tried that with stopped and absent and neither worked, the only parameter option that had any effect was “killed”.
Thanks and forgive my ignorance, I’ve spent days googling and asking IRC. Neither have turned up much in the way of knowledge or examples.