StefanScherer / dockerfiles-windows

Various Dockerfiles for Windows Containers
MIT License
1.11k stars 396 forks source link

Switched to Nanoserver for smaller images #404

Closed rmcolbert closed 5 years ago

rmcolbert commented 5 years ago

To reduce overall container size by a factor of 10, I reconfigured the Dockerfile to pull the nanoserver build of PowerShell Core, updated the generate-certs.ps1 to add LibreSSL to the path at the start of the script (so we didn't hit compatibility issues w/ PowerSell 6.2) and updated the scripts & README to reflect the container running under the containeruser context instead of containeradministrator.

The Dockerfile uses powershell:nanoserver-1809 as the base image (needed for AppVeyor to succeed)

StefanScherer commented 5 years ago

Thanks @rmcolbert that is a very good idea. AppVeyor also just builds the 2019 variant, so let's upgrade this image!

rmcolbert commented 5 years ago

The latest powershell base container image is 1809 which is what the Dockerfile references. It could be updated to pull the latest nanoserver container on build though.

StefanScherer commented 5 years ago

Uploaded to Docker Hub. Down from 6 GB to < 200 MB 🎉

Screen Shot 2019-04-27 at 5 02 39 PM
rmcolbert commented 5 years ago

I just doublechecked ... nanoserver-1809 is the same build # as Server 2019, so we're already there. the powershell:nanoserver container is actually 1709 right now which AppVeyor choked on.