Proposal: Introduce Dockerfiles for windowsservercore#222
Proposal: Introduce Dockerfiles for windowsservercore#222StefanScherer wants to merge 1 commit intonodejs:masterfrom
Conversation
|
This is great! 😄 Now we just need a CI capable of running Docker for Windows so we can make sure things don't break! |
| ENV NODE_VERSION 4.5.0 | ||
| ENV NODE_SHA256 16aab15b29e79746d1bae708f6a5dbed8ef3c87426a9408f7261163d0cda0f56 | ||
|
|
||
| RUN powershell -Command \ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@tianon can Docker Hub build Docker Images for Windows? |
|
@Starefossen not yet, also AppVeyor waits for Windows Server 2016 GA. |
|
I'm more concerned if we need more dev dependencies to make it usable for the community. Maybe we should add Python and probanly https://github.com/felixrieseberg/windows-build-tools to allow compiling native node modules as well. The golang image without git was also not really usable. |
|
I just tested the 6.5.0 Dockerfile with another line without any further optimizations RUN npm install --global --production windows-build-toolsbut then the Docker image increases from 7.9 GB to 11.5 GB: I personally don't have the use case of compiling native node modules and build a Docker image with that for distribution. My workflow would look like this: Run |
|
@StefanScherer consider using the |
|
@friism I've tried several times to adapt the Dockerfile to PowerShell without the CMD variable names, but it seems that there is a strange problem using quotes for strings. shows the correct string after the So I keep it as it is right now. |
|
@StefanScherer in my own testing with PowerShell's string interpolation, it had odd edge cases that made it more trouble than it was worth; I found either |
224a0ea to
d044e93
Compare
|
@tianon Thanks. I've added similar workarounds to introduce the |
d044e93 to
05a82ed
Compare
|
@chorrell note that there may also (likely) be a |
|
@chorrell Thanks for #239. Tried something similar today morning, but you know your test scripts better than I. |
|
At the time I thought it might make things simpler to omit the We'll want to probably modify the |
05a82ed to
ea2dabf
Compare
|
Anything I can do to push this forward a little bit? |
misunderstanding, I wasn't thinking about tags
|
Was there still an open question about doing CI? I don't have any experience running Docker in Windows and I don't really have a handle on how to test this or what we'd use for automated CI. |
|
Something like But I think there is more CI to push to Docker Hub as well, right? Jenkins? So you would need eg. a Windows 2016 Jenkins slave for further steps. |
|
The push to docker hub is all manual via a PR e.g., docker-library/official-images#2281 AppVeyor sounds like it might be an option for validating the images then? |
|
Yes, they plan to setup Win2016 + nanoserver build agents with preloaded base images microsoft/windowsservercore + microsoft/nanoserver. |
|
Also, I think a few remaining tasks are:
|
|
OK, so we probably want to wait until AppVeyor has Windows server 2016. Afaik, the build group doesn't have any 2016 machines in the jenkins/ci setup: https://ci.nodejs.org/computer/ |
|
For example Azure has prebuilt Win2016+Containers including Docker engine preinstalled, there is also an up-to-date "Deploy to Azure" template here. I can have a look at the |
|
OK, that would be up to the @nodejs/build group to setup I guess. |
|
The |
244e21e to
5e7fd92
Compare
|
Updated to Node 4.7.0, 6.9.2 and 7.2.1 :-) |
|
FYI streamlined the windows side with the msi (of course wouldn't work with nano though) |
|
Python has a splitter between Windows and Linux so could be possible to easily implement with the proper tags and automated building mechanism as discussed above The ones provided by @StefanScherer and myself both are natively supported within Windows Server 2016 Server (and even Azure Server 2016 /w containers ;) ) |
|
FYI, if setting up a Win2016+Docker build agent is too hard, try AppVeyor's new build agent appveyor/ci#1150 using a simple appveyor.yml like mine. |
|
Any progress having an Win 2016 server to provide official Node.js Windows Docker images? |
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
5e7fd92 to
e4f9a12
Compare
|
@StefanScherer what about adding appveyor machinery to the PR? |
|
@friism Thanks, already working on a new PR that introduces both nano + core + appveyor.yml :-) |
|
Closing, see #362 for a more up to date PR with appveyor.yml |
After
golangnow has its first Windows Docker image on Docker Hub it is time fornodeto provide an official Windows Docker image as well.This PR is a proposal to build and push Windows Docker images for the
windowsservercorevariant which works on Windows 10 + Docker 4 Windows Beta 31++ or Windows Server 2016.The
test-build.ps1can be called to build the images. It downloads the ZIP files for Node.js 4.7.0, 6.9.2 and 7.2.1 and builds these Docker images:In my previous work building a Windows Docker image I used the MSI packages which can be found here https://github.com/StefanScherer/dockerfiles-windows/tree/master/node, but this results in a slightly bigger Docker image as Windows caches the MSI packages in a second place even after removing it in the Dockerfile. So I switched to the ZIP files.
The labels for the Docker images are based on the work for the
golangDocker images.See also:
For information about how to get Docker running on Windows, please see the relevant Windows Server Quick Start guide provided by Microsoft.
See also #223 for the nanoserver Dockerfile proposal.