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

Proposal: Introduce Dockerfiles for nanoserver #223

Conversation

StefanScherer
Copy link

@StefanScherer StefanScherer commented Aug 25, 2016

As mentioned in #222 here is a proposal to build Windows Docker images with Node.js 4.7.0, 6.9.2 and 7.2.1 based on the Windows nanoserver base image.

This allows Windows 10 1607 and Server 2016 users build and run Node.js in a Docker container.

The test-build.ps1 can be called to build the images, either on a Windows 10 machine or a Windows Server 2016 machine. It downloads the ZIP files for Node.js 4.7.0, 6.9.2 and 7.2.1 and builds these Docker images:

  • node:4.7.0-nanoserver
  • node:4.7.0-nanoserver-onbuild
  • node:6.9.2-nanoserver
  • node:6.9.2-nanoserver-onbuild
  • node:7.2.1-nanoserver
  • node:7.2.1-nanoserver-onbuild

For information about how to get Docker running on Windows, please see the relevant "Quick Start" guide provided by Microsoft:

or use Docker for Windows Beta 26++ to try this PR.

Notes:

Using curl or wget in PowerShell in NanoServer is far from easy. The only working example I used for this Dockerfiles is from nanoserver/golang in the Microsoft/Virtualization-Documentation repo.

Further thoughts about size:

My previous work which just does a COPY deployment of Node.js into a nanoserver container image and results in smaller Docker images than running the PowerShell script downloading the ZIP etc.

PS C:\Users\vagrant\docker-node> docker images
REPOSITORY                   TAG                        IMAGE ID            CREATED              SIZE
node                         6.4.0-nanoserver-onbuild   e1dae6267768        About a minute ago   1.006 GB
node                         6.4.0-nanoserver           7737552eb883        About a minute ago   1.004 GB
node                         4.5.0-nanoserver-onbuild   4102e90ae44f        3 minutes ago        1.003 GB
node                         4.5.0-nanoserver           c69755c3eaa4        4 minutes ago        1.001 GB
stefanscherer/node-windows   6-nano                     8aaa86fdc12a        3 days ago           999 MB
stefanscherer/node-windows   4-nano                     384c4d4b0cee        3 days ago           995.2 MB
microsoft/nanoserver         latest                     3a703c6e97a2        10 weeks ago         969.8 MB

@tianon
Copy link
Contributor

tianon commented Aug 25, 2016 via email

@StefanScherer
Copy link
Author

Updated this PR to latest versions Node.js 4.6 and 6.7. Introduced SHELL instruction, simplified downloading zip file.

@chorrell
Copy link
Contributor

chorrell commented Sep 29, 2016

The recent failure looks like an issue with the test. The test-build.sh script assumed there would be a dockerfile here: 4.6/windows/Dockerfile.

I opened #239 to improve the test script and once that lands you should probably rebase and try again.

@chorrell
Copy link
Contributor

Although, ^ being said, I don't think the test build will ultimately run successfully since I don't think Travis-Ci has the necessary Windows/Docker support.

I see you have a test-build.ps1 test build script. So I guess ultimately we want a separate approach for testing the Windows image and will need to update test-build.sh.

chorrell

This comment was marked as off-topic.

@StefanScherer
Copy link
Author

Updated to Node.js 4.7.0, 6.9.2 and 7.2.1 :-)
These Dockerfiles are built in my AppVeyor proof-of-concept https://ci.appveyor.com/project/StefanScherer/dockerfiles-windows/build/1.0.21

@StefanScherer
Copy link
Author

Closing, see #362 for a more up to date PR with appveyor.yml

@StefanScherer StefanScherer deleted the introduce-nanoserver-dockerfiles branch July 23, 2017 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants