Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Windows build 1809 compatibility #49

Closed
wants to merge 2 commits into from

Conversation

jwlogemann
Copy link

@jwlogemann jwlogemann commented Feb 20, 2019

I've changed the Dockerfile to be Windows build 1809 compatible. This is needed when using Traefik as a Kubernetes ingress controller in Windows Server 2019

Fixes #44

Build Dockerfile from nanoserver:1809 for windows 2019 compatibility. 

The netapi32.dll is needed to work around a Go bug with Nanoserver. The file is from mcr.microsoft.com/windows/servercore:1809
An alternative way to do this would be with a multistage build.
@zlepper
Copy link

zlepper commented Apr 2, 2019

I can confirm that it seems to be working. It is at least both building and running.

For anyone currious why the "netapi32" file is there, it's to fix: golang/go#21867

@Barsonax
Copy link

Barsonax commented Apr 9, 2019

Any ETA when this is getting merged?

@@ -1,6 +1,7 @@
FROM microsoft/nanoserver:sac2016
FROM mcr.microsoft.com/windows/nanoserver:1809
Copy link
Contributor

Choose a reason for hiding this comment

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

  • For the Docker image name change: it should be done in the file tmpl.Dockerfile instead of here
  • For the tag (version) change, it should be done in the scripts update*.sh as they generate these Dockerfiles from the templates.


COPY ./traefik.exe /traefik.exe
COPY ./netapi32.dll /windows/system32/netapi32.dll
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be downloaded in the same manner as traefik.exe is, so it can be updated when the update*.sh scripts are called.

@dduportal
Copy link
Contributor

Hi @jwlogemann, thanks for this contribution, it's cool!

This PR is currently being blocked for the following reasons:

  • As you figured out (and implemented in this PR), the library netapi32.dll is missing in the Docker based image of nanoserver, since nanoserver-18.03. This library is required for Traefik (thanks @zlepper to point the thread in net: lookup_windows.go uses APIs that are no longer in Nano Server golang/go#21867 to us). So this is a dependency for the Windows-based Docker image for Traefik:
    • It has to be tracked and updatable (because it's a dependency with it's own lifecycle)
    • It has to be trusted (at least the retrieving method should use an official source)
    • It has to be specified only for declination that requires it (nanoserver:sac2016 doesn't for example)

Alas, by committing directly the binary as this PR, neither of these 3 elements are fulfilled, which would (at least) make the image refused by Docker when trying to publish it.

What should we do then?

Well, TL;DR; we have to wait for docker-library/official-images#5929 to be ready.

Details:

  • @StefanScherer is doing a great job at providing different declinations of Windows-based Docker images for Traefik here: https://github.com/StefanScherer/dockerfiles-windows/tree/master/traefik. He's solving the challenge of the netapi32.dll by using a Multi-Stage Docker build.
  • As the Traefik Docker image is built by Docker's library for official images, there is no Multi-stages build support, neither any "2 steps" builds documented as for today (ref. [WIP] Multi-stage build #14 ).
  • As for today, updating this repository utilises shell scripts (update*.sh) which download the right Traefik binaries, extracts dependencies for Alpine-based images (certificates) and generates Dockerfiles according to the version of Traefik to be released. This process is run under a Linux machine (Travis, smeaphore, or contributor), so it ain't easy to retrieve the DLL:
    • No Docker Windows Engine, so no way to docker run/build to extract the file.
    • Extracting the tar image with tools like skopeo would be a pain as the Windows image are Gigabytes-sized...

Proposal: blocking this PR until Multi-stage build are supported in Docker's official library.

@jorisscheppers
Copy link

Proposal: blocking this PR until Multi-stage build are supported in Docker's official library.

As docker-library/official-images#5929 has recently been merged, can work on this PR continue? I would really like to see Traefik work on Windows Server 2019!

@dduportal
Copy link
Contributor

Yes totally, let's update this PR following the new bashbrew!

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

Successfully merging this pull request may close these issues.

Missing Windows Server 2019 Image
6 participants