Skip to content

Add nanoserver-1809 Windows container images #9

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

Closed
wants to merge 2 commits into from

Conversation

awakecoding
Copy link

This pull request adds nanoserver-1809 Windows container images for traefik, as a complement for the servercore-1809 container images. The nanoserver images are MUCH smaller than the servercore images, but they have less Windows host compatibility. The nanoserver-1809 tag is compatible with Windows Server 2019 with process-level isolation, but it can still be run on Windows 10 with Hyper-V isolation. One small difference between nanoserver is that it uses ContainerUser instead of ContainerAdministrator by default, I've changed it to avoid potential issues with regards to file permissions, making it usable as a drop-in replacement for the servercore images.

I am not very familiar with the structure of this repository, but I noticed that there were v1 and v2 Dockerfile templates, and a Dockerfile containing the latest 1.x version. I made both templates but I used the latest 2.x in the non-templated Dockerfile for testing. I built the dockerfile like this: docker build . -t v2.4.8-traefik-nanoserver-1809 and I was able to use it as a replacement for the corresponding servercore image.

Notice that I've used "nanoserver-1809" as the container tag, and not "windowsnanoserver-1809". Just like we don't repeat "alpinelinux" in "alpine" tags, we don't really need to repeat "windows" in "servercore" and "nanoserver" tags. I have recently helped MongoDB get their nanoserver container images, and they've decided to use "nanoserver" instead of "windowsnanoserver", so I suggest traefik just follows the same convention. I use the same one for all of my own container images, and most windows container images now use this convention.

Let me know if you have any questions, I'd be more than happy to help. I just want official nanoserver traefik images upstream to avoid the need to separately maintain unofficial container images on my side. traefik and mongo were the only two third-party containers I needed to fully complete my switch to nanoserver.

@ldez ldez changed the title Add nanoserver-1809 Windows container images (much smaller, still works!) Add nanoserver-1809 Windows container images Jun 4, 2021
@ldez ldez added the kind/enhancement a new or improved feature. label Jun 4, 2021
@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/windows/nanoserver:1809

Choose a reason for hiding this comment

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

Just out of curiosity, is the netapi32.dll trick no longer needed to run Traefik in a nanoserver container?
For reference: https://github.com/StefanScherer/dockerfiles-windows/blob/main/traefik/Dockerfile.1809#L3 :-)
PS: I haven't done much Windows Containers lately, but would like to know what might have improved since my first attempts.

Copy link
Author

Choose a reason for hiding this comment

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

Ah! that would explain the error I've seen with the 1.x container image, I'll do some additional tests

Copy link
Author

Choose a reason for hiding this comment

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

I confirm that the issue only affects traefik 1.7, but not 2.4, which is a bit odd. I'll modify the template for 1.x to use the workaround

Choose a reason for hiding this comment

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

Thanks. Good to know that Traefik 2.4 works without that workaround.
That was a nasty thing discussed in golang/go#21867 when a Golang program used user.Current(), mostly used in glog.

@awakecoding
Copy link
Author

@ldez @StefanScherer there you go, I applied the netapi32.dll missing DLL fix, and both 1.7 and 2.4 work just fine now. I can only assume 2.4 no longer needs it, but we cannot be sure that no code path leads to that DLL being loaded, so I applied the fix in both 1.x and 2.x Dockerfile templates.

@awakecoding
Copy link
Author

@StefanScherer I just noticed you are one of the reviewers for this PR, are you one of those who can approve it as well? I don't know if you get marked as a reviewer simply for commenting on it. I didn't know you were involved with traefik :)

@ldez
Copy link
Contributor

ldez commented Jun 4, 2021

@awakecoding please stop spamming me (Twitter, GitHub, ...), just be patient.

We (the Traefik maintainers) will review this PR.

https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews

@awakecoding
Copy link
Author

Sorry about that, I got a bit too excited. Have a good weekend!

@awakecoding
Copy link
Author

Hi! It's been a month since I opened this PR already, is there a chance we could get it reviewed and merged? This is literally the only last third-party container I need with a nanoserver container image. If I can't get it in a timely manner I will have to start publishing my own, but I would rather use the official container image that is always up to date instead.

@apetrozzelli
Copy link

Hi, any news about this?

@ashanrath
Copy link

At the risk of beating a dead horse, is there anything specifically holding this one up? Happy to help out if I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants