# Docker container using ansible

**URL:** <https://forum.ansible.com/t/docker-container-using-ansible/22809>\
**Category:** Ansible Project\
**Created:** [October 17, 2016, 6:40pm UTC](https://forum.ansible.com/t/docker-container-using-ansible/22809 "2016-10-17T18:40:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jl28777](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jl28777](https://forum.ansible.com/u/jl28777)\
**Post date:** [October 17, 2016, 6:40pm UTC](https://forum.ansible.com/t/docker-container-using-ansible/22809/1 "2016-10-17T18:40:21Z")

</div>

Hi,

I am trying to create docker containers with the help of ansible playbook. Need help!

Thanks

---

<div class="post-metadata">

**Author:** ![Diego\_Blanco](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@Diego\_Blanco](https://forum.ansible.com/u/Diego_Blanco)\
**Post date:** [October 19, 2016, 7:03pm UTC](https://forum.ansible.com/t/docker-container-using-ansible/22809/2 "2016-10-19T19:03:11Z")

</div>

Hi,

you will need to use the [docker image module](http://docs.ansible.com/ansible/docker_image_module.html) to ensure you have the needed docker image and then use the [docker container module](https://docs.ansible.com/ansible/docker_container_module.html) to create a new container and start it. However, there are serveral problems with the current version of ansible that may be in your way. I tried to work with docker through ansible a couple of days ago and I had to face all these bugs:

[https://github.com/ansible/ansible-modules-core/issues/705](https://github.com/ansible/ansible-modules-core/issues/705)

[https://github.com/ansible/ansible-modules-core/issues/4770](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fansible%2Fansible-modules-core%2Fissues%2F4770&sa=D&sntz=1&usg=AFQjCNFjwu7udUZHGrN4xR3kD9BYOZ1PtQ)  
[https://github.com/ansible/ansible-modules-core/issues/3528](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fansible%2Fansible-modules-core%2Fissues%2F3528&sa=D&sntz=1&usg=AFQjCNFMuKGPq6FuLIIQf-jK6YsqddIk2Q)  
[https://github.com/ansible/ansible-modules-core/issues/1220](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fansible%2Fansible-modules-core%2Fissues%2F1220&sa=D&sntz=1&usg=AFQjCNHaHAOEFiwAymNMkykZ2mPG_cos7Q)

If you dont want to wait for the new version with this fixes and also apply some workarounds, maybe you should use the command module and call docker directly.

Regards

quarta-feira, 19 de Outubro de 2016 às 17:07:24 UTC+2, jl2…@umbc.edu escreveu:

---

<div class="post-metadata">

**Author:** ![Alexander\_H\_Laughlin](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexander\_H\_Laughlin](https://forum.ansible.com/u/Alexander_H_Laughlin)\
**Post date:** [October 19, 2016, 10:18pm UTC](https://forum.ansible.com/t/docker-container-using-ansible/22809/3 "2016-10-19T22:18:05Z")

</div>

The relevant documentation may be found here: [http://docs.ansible.com/ansible/docker\_module.html](http://docs.ansible.com/ansible/docker_module.html)

Best of luck!
