# Can Ansible execute a Dockerfile on Docker to setup platforms for PXE boots?

**URL:** <https://forum.ansible.com/t/can-ansible-execute-a-dockerfile-on-docker-to-setup-platforms-for-pxe-boots/29014>\
**Category:** Ansible Project\
**Created:** [November 12, 2018, 9:17pm UTC](https://forum.ansible.com/t/can-ansible-execute-a-dockerfile-on-docker-to-setup-platforms-for-pxe-boots/29014 "2018-11-12T21:17:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EspressoBeanies](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@EspressoBeanies](https://forum.ansible.com/u/EspressoBeanies)\
**Post date:** [November 12, 2018, 9:17pm UTC](https://forum.ansible.com/t/can-ansible-execute-a-dockerfile-on-docker-to-setup-platforms-for-pxe-boots/29014/1 "2018-11-12T21:17:38Z")

</div>

I’d like to setup an HTTP server on a Docker image to serve as a platform for PXE booting and I don’t see a clear way for Ansible to be able to execute a Dockerfile on a local Docker instance to spawn an HTTP server. I don’t know if it’d be effective to continuously build and destroy a docker image housing this PXE boot but wanted to see if at least a setup is possible from what I specify in my Dockerfile.

---

<div class="post-metadata">

**Author:** ![Thad\_Guidry](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Thad\_Guidry](https://forum.ansible.com/u/Thad_Guidry)\
**Post date:** [November 12, 2018, 10:25pm UTC](https://forum.ansible.com/t/can-ansible-execute-a-dockerfile-on-docker-to-setup-platforms-for-pxe-boots/29014/2 "2018-11-12T22:25:07Z")

</div>

Lots of ways to handle this…

What you are after is called “baremetal provisioning”. [https://www.ansible.com/use-cases/provisioning](https://www.ansible.com/use-cases/provisioning)

Start with reading this thread… [https://www.reddit.com/r/ansible/comments/7c7lsg/install\_os\_on\_bare\_metal/](https://www.reddit.com/r/ansible/comments/7c7lsg/install_os_on_bare_metal/)

And lots of existing roles already on Ansible Galaxy to help you get started… [https://galaxy.ansible.com/search?keywords=pxe&order\_by=-relevance&page\_size=100](https://galaxy.ansible.com/search?keywords=pxe&order_by=-relevance&page_size=100)

As an aside, you might also want to learn about the new Ansible Container.

**Introducing Ansible Container**  
Container users have relied on Ansible for some time to help orchestrate the process of building their containers,  
but to fully automate the process of container building to production deployment still required a host of additional tooling.  
Not anymore.

[https://www.ansible.com/blog/ansible-container-project](https://www.ansible.com/blog/ansible-container-project)  
[https://www.ansible.com/blog/ansible-container-0-9](https://www.ansible.com/blog/ansible-container-0-9)  
[https://www.ansible.com/integrations/containers/ansible-container](https://www.ansible.com/integrations/containers/ansible-container)
