Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile for Windows #68

Merged
merged 3 commits into from
Apr 19, 2018
Merged

Conversation

lippertmarkus
Copy link
Contributor

@lippertmarkus lippertmarkus commented Apr 11, 2018

Adding Dockerfile for Windows. Unfortunately building OpenResty inside Docker during image build is currently not possible due to issues with MSYS2/Cygwin or similar environments (see docker/for-win#262).

Instead the Dockerfile is using the prebuilt binaries for Windows and also installs Perl. You can try the image on Windows:

docker pull lippertmarkus/openresty:windows
docker run lippertmarkus/openresty:windows

I would recommend AppVeyor for CI on Windows. It worked flawlessly in my tests, is free for open-source software and easy to integrate:

@neomantra
Copy link
Member

@lippertmarkus Thank you for this contribution and sorry for not replying right away. I think the approach of using the upstream OpenResty binaries is best. I intend to eventually slim down the number of Dockerfiles and keep just the OpenResty binaries and a couple others.

I will start setting up Appveyor for this.

Some minor fixes / notes....

Add # https://github.com/openresty/docker-openresty on the second line.

Add maintainer information as a label in the final image LABEL maintainer=""

Does there really need to be three FROMs? Can't the bottom image's FROM base just include everything from the first one?

@lippertmarkus
Copy link
Contributor Author

@neomantra Thanks for the feedback, I commited the changes.

@neomantra neomantra merged commit f0ee424 into openresty:master Apr 19, 2018
@lippertmarkus lippertmarkus deleted the add-windows branch April 20, 2018 14:47
@neomantra
Copy link
Member

All the Appveyor builds are working and you should see both openresty/openresty:windows and openresty/openresty:1.13.6.1-2-windows on Docker Hub.

I note that they are 6 GB. Is that normal for a Windows Docker image? Is there some easy cleanup we can do? The OpenResty Windows download is only 12 MB.

@lippertmarkus
Copy link
Contributor Author

lippertmarkus commented Apr 20, 2018

Perfect! You could update the image description on Docker Hub also (https://hub.docker.com/r/openresty/openresty/).

Unfortunately this is normal, yes. The base microsoft/windowsservercore image is just slightly smaller than 6 GB (https://hub.docker.com/r/microsoft/windowsservercore/tags/). This will hopefully get better with future images (microsoft/windowsservercore:1709 for Version 1709 of Windows Server is already "only" 3GB).

Also we can't use the smaller (~500 MB) microsoft/nanoserver images (https://hub.docker.com/r/microsoft/nanoserver/) as they only support running 64 bit binaries and nginx/openresty can't be compiled as a 64 bit binary as far as I know?

@neomantra
Copy link
Member

Docker Hub updated, thanks for the reminder and the info about Windows image sizes.

@lippertmarkus
Copy link
Contributor Author

To correct myself: It is possible to build 64 bit binary of nginx (e.g. http://kiyolee.blogspot.de/2012/04/building-nginx-120-with-64-bit-visual-c.html) but nginx doesn't officially provide them for downloading.
If openresty wants to support 64 bit binaries for Windows in future anyway I surely can change the Dockerfile to use the smaller microsoft/nanoserver as base image.

@agentzh
Copy link
Member

agentzh commented Apr 23, 2018

@lippertmarkus Official OpenResty Win64 packages are already out:

https://groups.google.com/d/msg/openresty-en/bTfqTjshcX4/uP8qF0EpAgAJ

@lippertmarkus
Copy link
Contributor Author

@agentzh Thanks for pointing this out!
@neomantra I tried it and it worked fine: lippertmarkus@649e0a7
Resulting image is around 560MB (https://hub.docker.com/r/lippertmarkus/openresty/tags/). Should we wait until the next formal release before publishing this? I will create another pull request then.

@neomantra
Copy link
Member

Yes, let's wait and coordinate with the official OpenResty release of 1.13.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants