# how to build docker image?

**URL:** <https://forum.ansible.com/t/how-to-build-docker-image/17035>\
**Category:** Ansible Project\
**Created:** [December 11, 2014, 11:18pm UTC](https://forum.ansible.com/t/how-to-build-docker-image/17035 "2014-12-11T23:18:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shunsuke\_Mie](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Shunsuke\_Mie](https://forum.ansible.com/u/Shunsuke_Mie)\
**Post date:** [December 11, 2014, 11:18pm UTC](https://forum.ansible.com/t/how-to-build-docker-image/17035/1 "2014-12-11T23:18:09Z")

</div>

I find docker\_image module, but this module is deprecated.  
So now, I using commands module.

Can i build docker image any way?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 12, 2014, 1:00am UTC](https://forum.ansible.com/t/how-to-build-docker-image/17035/2 "2014-12-12T01:00:16Z")

</div>

Yeah so we find it odd that a Dockerfile, that usually contains ansible-playbooks, would be executed by Ansible.

We think in most cases it would be executed by a build system (like Jenkins), or even a Makefile… and that like most packaging tools it would be done before the ansible-playbook was run.

So the command module is we think the nice way to go, if you really want to do that, and I think that’s fine.

Hope this helps!
