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

Windows containers support #384

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

joeapearson
Copy link

Adds support for Windows containers (as proposed in #360 ).

Unlike Linux-flavoured containers, Windows insists that a containers base OS and host OS version must match precisely. Therefore I've added both the Windows image name and tag into the tagged Erlang images. In practice, a mismatched host + container OS may work but be prepared for sudden and rather cryptic failures. Microsoft does appear to be actively improving this situation so perhaps this may become a thing of the past eventually.

I've picked a Windows base image version of 10.0.17763.2114 because that's the current version of Windows in Azure Kubernetes Service, in anticipation that this will be the correct version for most users at the time of writing. Adding more base images should be simply a case of adding to the actions matrix.

Things that are missing:

  • In the original Linux build action a test suite from https://github.com/docker-library/official-images.git is run. It looks like there is some support for windows containers here but I'm not sure how this should be implemented.
  • windows/nanoserver support is not present. Adding support would be a case of figuring out what missing dependencies there are for both the installer and Erlang/OTP itself, and adding them into the nanoserver image at build time. This is tedious work but the bonus would be a much reduced image size. I suggest leaving this as a separate matter for a future MR.

@joeapearson joeapearson marked this pull request as ready for review December 22, 2021 19:54
@joeapearson
Copy link
Author

Any comments / reviews / suggestions for this before it can be merged?

del /f .\otp-installer.exe

# This is a workaround for nanoserver where not possible to set PATH using setx or similar
ENV PATH="C:\Windows\system32;C:\Windows;C:/Program Files/erl-${OTP_VERSION}/bin"
Copy link

Choose a reason for hiding this comment

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

So PowerShell arbitrarily understand back- and forward-slashes? In any case, I would think it better to stick to one "style" to avoid any confusion(s).

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, good spot, fix coming up

@ryanhendersonabs
Copy link

@joeapearson I'm just curious -- since your original post, have you learned any more on why the nano server image is not compatible at the moment? We would very much like to get the smaller image size (specifically for RabbitMQ).

I'm willing to contribute a PR, but unfortunately I wouldn't even know where to start or if I'd actually be any help with no erlang contribution or low-level Windows dev experience.

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

Successfully merging this pull request may close these issues.

3 participants