# ansible testing using docker

**URL:** <https://forum.ansible.com/t/ansible-testing-using-docker/25159>\
**Category:** Ansible Project\
**Created:** [August 1, 2017, 7:04pm UTC](https://forum.ansible.com/t/ansible-testing-using-docker/25159 "2017-08-01T19:04:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitted](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@gitted](https://forum.ansible.com/u/gitted)\
**Post date:** [August 1, 2017, 7:04pm UTC](https://forum.ansible.com/t/ansible-testing-using-docker/25159/1 "2017-08-01T19:04:43Z")

</div>

Hi,

How do you guys use docker with ansible to test out your playbooks? Does it take a long time to spin up the image and install things?

I’m curious if the workflow is any different than just using vagrant/virtualbox.

I am currently doing it the iterative way using a real cloud server but I am sure there is a better way 🙂

---

<div class="post-metadata">

**Author:** ![Mischa\_ter\_Smitten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mischa\_ter\_Smitten](https://forum.ansible.com/u/Mischa_ter_Smitten)\
**Post date:** [August 2, 2017, 5:10pm UTC](https://forum.ansible.com/t/ansible-testing-using-docker/25159/2 "2017-08-02T17:10:26Z")

</div>

Vagrant works fine, but is a bit slow. Docker is fast, but might not match what you use in production.

Some useful resources:

- [https://github.com/Oefenweb/ansible-fail2ban/blob/master/Vagrantfile](https://github.com/Oefenweb/ansible-fail2ban/blob/master/Vagrantfile)  
- [https://github.com/Oefenweb/ansible-fail2ban/blob/master/.travis.yml](https://github.com/Oefenweb/ansible-fail2ban/blob/master/.travis.yml)  
- [https://github.com/geerlingguy/ansible-role-git/blob/master/.travis.yml](https://github.com/geerlingguy/ansible-role-git/blob/master/.travis.yml)  
- [https://github.com/metacloud/molecule/blob/master/README.rst](https://github.com/metacloud/molecule/blob/master/README.rst)
