-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM microsoft/windowsservercore | ||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is basically There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😭 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.