# Another Ansible Question

**URL:** <https://forum.ansible.com/t/another-ansible-question/32476>\
**Category:** Ansible Project\
**Created:** [March 16, 2020, 10:02am UTC](https://forum.ansible.com/t/another-ansible-question/32476 "2020-03-16T10:02:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Cooper](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michael\_Cooper](https://forum.ansible.com/u/Michael_Cooper)\
**Post date:** [March 16, 2020, 10:02am UTC](https://forum.ansible.com/t/another-ansible-question/32476/1 "2020-03-16T10:02:17Z")

</div>

Hey Guys,

I am trying to get ansible working on docker. The image that I am using is ansible/ansible and there are no instructions for a run line on it.

So this is what I tried but it doesn’t work.

docker run -dit --name cfANS --ip xxx.xxx.x.xx --network=CFSNET -p 22:22 -v /mnt/clusterfs/ansible:/etc/ansible ansible/ansible

The following is the result of the run line:  
a1cd233bf9f2 ansible/ansible:ubuntu1604 “/sbin/init” 7 seconds ago Exite d (1) 4 seconds ago

Any help with this would be appreciated  
Thanks everyone

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [March 16, 2020, 10:16am UTC](https://forum.ansible.com/t/another-ansible-question/32476/2 "2020-03-16T10:16:50Z")

</div>

Hi,

according to the description on  
[https://hub.docker.com/r/ansible/ansible](https://hub.docker.com/r/ansible/ansible) the Docker image  
ansible/ansible is "[...] for automated testing of Ansible. They do not  
include Ansible and are not for end users."

So please don't use that image if you want to run Ansible.

I'm not sure whether there are pre-built images for running Ansible,  
especially because the requirements depend a lot on which plugins you  
are using. You probably need to create your own: base it on some image  
which includes Python and install Ansible and all requirements via pip.

Cheers,  
Felix

PS: please note that not all participants are male on this mailing list.

---

<div class="post-metadata">

**Author:** ![Michael\_Cooper](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michael\_Cooper](https://forum.ansible.com/u/Michael_Cooper)\
**Post date:** [March 16, 2020, 12:05pm UTC](https://forum.ansible.com/t/another-ansible-question/32476/3 "2020-03-16T12:05:08Z")

</div>

Hello Felix,

I kind of figured that was going to be the story.

It would be nice if there was an easy way to do this, I am tring to get away from the VM route and go with containers. I will have to keep researching.

Thanks,

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [March 16, 2020, 8:19pm UTC](https://forum.ansible.com/t/another-ansible-question/32476/4 "2020-03-16T20:19:11Z")

</div>

Hi Michael

You might want to check out ansible-runner: [https://ansible-runner.readthedocs.io/en/latest/container.html](https://ansible-runner.readthedocs.io/en/latest/container.html)  
There’s also something like molecule which is designed for testing roles, and can be used with docker: [https://molecule.readthedocs.io/en/latest/index.html](https://molecule.readthedocs.io/en/latest/index.html)  
If you want to see how the latter works, check out this exercise: [https://github.com/pharriso/ansible\_workshop/tree/master/exercises/ansible\_rhel/molecule](https://github.com/pharriso/ansible_workshop/tree/master/exercises/ansible_rhel/molecule)

Regards  
Phil.

---

<div class="post-metadata">

**Author:** ![Claudia\_de\_Luna](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Claudia\_de\_Luna](https://forum.ansible.com/u/Claudia_de_Luna)\
**Post date:** [March 17, 2020, 2:54am UTC](https://forum.ansible.com/t/another-ansible-question/32476/5 "2020-03-17T02:54:34Z")

</div>

See if this helps at all

[https://gratuitous-arp.net/ansible-server-in-docker-for-network-engineers/](https://gratuitous-arp.net/ansible-server-in-docker-for-network-engineers/)

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [March 17, 2020, 3:11am UTC](https://forum.ansible.com/t/another-ansible-question/32476/6 "2020-03-17T03:11:43Z")

</div>

I created a docker container to install Ansible for testing different versions, etc. As folks here have mentioned, it’s not really the purpose of the ansible/ansible image. However, I just run it with a sleep command at run time, for like 29000 seconds (eight hours) since the container has to execute something. It’s a bit of a hack, but then I have a purpose built docker container with Ansible.
