# Nginx dockerfile

**URL:** <https://www.ruby-forum.com/t/nginx-dockerfile/243159>\
**Category:** NGINX\
**Created:** [August 27, 2015, 6:17am UTC](https://www.ruby-forum.com/t/nginx-dockerfile/243159 "2015-08-27T06:17:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 27, 2015, 6:17am UTC](https://www.ruby-forum.com/t/nginx-dockerfile/243159/1 "2015-08-27T06:17:05Z")

</div>

Hi,

I checked nginx code repository as well as Internet to see if I can  
get a Dockerfile to build nginx. I got a few references (like  
[GitHub - dockerfile/nginx: Nginx Dockerfile for trusted automated Docker builds.](https://github.com/dockerfile/nginx)) but those are essentially to  
_run_ nginx, not _build_ it.

I am looking to build different versions of nginx (say  
top-of-the-tree, latest-stable etc.) easily. It would be very  
convenient if a Dockerfile is presented with the source code which  
will build one of the versions mentioned above. If required, a slight  
modification can then build any version of nginx.

I would highly appreciate if somebody could point me to a source where  
I can get a Dockerfile which builds nginx.

Thanks,  
Atul.

---

<div class="post-metadata">

**Author:** ![Atul\_Sowani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@Atul\_Sowani](https://www.ruby-forum.com/u/Atul_Sowani)\
**Post date:** [August 28, 2015, 9:06am UTC](https://www.ruby-forum.com/t/nginx-dockerfile/243159/2 "2015-08-28T09:06:34Z")

</div>

Hello Atul,

Is this what you are looking for? Keep in mind I just threw this  
together to give you an idea of how you could do this and it should be  
tested. Let me know if you have any suggestions or questions.

> <https://github.com/kmjones1979/docker-nginx-compiled/blob/master/Dockerfile>

removed\_email\_address@domain.invalid:kmjones1979/docker-nginx-compiled.git

* * *

Kevin  
[http://nginx.org/](http://nginx.org/)

---

<div class="post-metadata">

**Author:** ![Atul\_Sowani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@Atul\_Sowani](https://www.ruby-forum.com/u/Atul_Sowani)\
**Post date:** [August 28, 2015, 11:27am UTC](https://www.ruby-forum.com/t/nginx-dockerfile/243159/3 "2015-08-28T11:27:56Z")

</div>

Hi Kevin,

Many thanks for the pointer. That is exactly what I am looking for.

Now counting on my own experience, I think such dockerfiles should be  
integrated with the nginx source code itself. This will make the nginx  
source code self-contained and build process consistent. Otherwise,  
developers like me will go in every direction looking out for a  
dockerfile and there could be different versions of it available from  
multiple sources. Having an official version along with source code  
will save a lot of pain and will bring good things along. It’s just  
like having Makefile along with the code. As long as the base image  
for container is available, I don’t see any reason not to include a  
dockerfile with source code. – Just a thought.

Thanks again for pointing me to the right source!

Best regards,  
Atul.
