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 building windows image #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions stable/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM microsoft/windowsservercore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we run nginx.exe in nanoserver?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StefanScherer It doesn't work currently, I tried. I'm guessing it uses 32bit APIs and relies on WoW. Someone should try to compile with 64-bit only toolchain for nanoserver.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, would be great for future versions of nginx.


SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV NGINX_VERSION 1.10.3
RUN Invoke-WebRequest -Uri https://nginx.org/download/nginx-$Env:NGINX_VERSION.zip -OutFile nginx.zip ; \
Expand-Archive nginx.zip -DestinationPath $Env:ProgramFiles ; \
Remove-Item -Force nginx.zip ; \
Move-Item $Env:ProgramFiles\nginx-* $Env:ProgramFiles\nginx

RUN setx /M PATH $($Env:PATH + ';' + $Env:ProgramFiles + '\nginx')

EXPOSE 80 443
WORKDIR "C:\Program Files\nginx"
CMD Start-Process -NoNewWindow -FilePath nginx.exe ; \
Add-Content logs\access.log 'nginx started...' ; Get-Content -Wait logs\access.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically tail -f -- can't we run nginx the same way in Windows that we do in Linux to get it to stay in the foreground and log to stdout/stderr?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianon I googled hard, but I don't think there's an elegant way to symlink the logfiles to stdout/err devices on Windows (they just don't exist).

I agree that this solution is super lame. The only reason it would be acceptable is because nginx on Windows is experimental in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭