-
Notifications
You must be signed in to change notification settings - Fork 94
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 Support #30
Comments
We'd definitely like to have them - the only blocker is figuring out how to make them actually work. There's an attempt here for example: alexcrichton@494237c |
Is there a list of unresolved issues with that attempt? |
🤷♂️ I guess a big one is that the build tools are kinda launched in a forked process on that branch and don't specify I have a branch in my fork that definitely hacky, still doesn't work, and still a WIP. Need to rebase and it's kinda annoying that generated "artifacts" are in this repo. |
My branch works, I can do that nifty "Compile your app inside the Docker container" but with Windows thing with the whole |
Awesome! I cargo-culted a bunch of the setup here from the python and golang images, so they'd be good places to look for Windows setup as well. |
By the way, if anyone is developing this on Windows 10 and not Windows Server: If you're on 10 and 1809, replace the |
I've decided to drop nanoserver from my efforts. It'll probably be great for those multi-stage builds where someone compiles something with Rust from the bigger windowsservercore-based images and copies it to nanoserver for running/runtime but it's probably inappropriate for a build tool. I mean, do you see an alpine image for rust? Though, I guess there's debian slim and a hypothetical alpine version would kinda be oddly supported in a weird way. But this is Microsoft country, and it takes years for them to trim more fat. |
The only reason there's no alpine image is that there isn't an x86_64-unknown-linux-musl rustc build yet. #10 |
Oh! I didn't see that. |
There are some straggling issues left I guess.
|
The GNU variant was predictably crazy easy to implement and definitely not encumbered. |
I have to take a break from this for now. If someone wants to take a crack at getting this upstreamed, have at it. There are MSVC and GNU Dockerfiles in here: https://github.com/nelsonjchen/docker-rust/tree/windows I am not sure how to get this integrated in with that |
That just generates the metadata blob that goes over to the docker-library/official-images repo - it doesn't need to run in the same OS as the docker image or anything. |
Oops, I meant |
Similarly, update.sh can create a Dockerfile for a Windows image without being run on Windows. Bashbrew is here: https://github.com/docker-library/official-images/tree/master/bashbrew |
Bashbrew explodes now in WSL with some nil dereference error. Not sure why. Anyway,
Along with the Unfortunately, only the https://ci.appveyor.com/project/nelsonjchen/docker-rust/builds/20890075 For Windows containers where the kernel doesn't match the image, nested virtualization is required. These jobs fail to build because Appveyor does not have nested virtualization. Unlike Linux containers, where there's a Linus to scream "WE DO NOT BREAK USERSPACE! Seriously. How hard is this rule to understand? We particularly don't break user space with TOTAL CRAP.", this is not the case for Windows. The userspace is designed to match the kernel. When the images match, Docker will run the container with process isolation much like on Linux systems. When they don't, Docker will launch a "nano" sized boot of a cut-down Windows VM with a matching kernel version. There's actually about a small but noticeable delay when Docker does this. On client Windows systems, this is the norm and is enforced since client Windows kernels can vary a lot. Only recently in a currently unreleased Docker version did some Microsoftie take off this limitation in a PR. Windows 10 Client 1809 and up can run images matching the kernel with process isolation, though it's branded as for dev and test only. While not currently available and somewhat useless, I added the Another issue is that I think Appveyor only provides building one job at a time. I could have sworn they used to provide more concurrency in the past for OSS projects. 🤷♂️ I might have been confusing it with some other CI service . Right now, these images take about 16 minutes for the GNU variant and 32 minutes for the MSVC variant. Pretend the nested virtualization wasn't an issue. To check all these, it would take about 192 minutes on Appveyor. This list will grow a bit as more 10-year supported LTSC releases of Windows happen. I have a better, cheaper, and faster proposal. Could we use Azure Pipelines? They provide 10 concurrent Windows (or any OS including Mac or Linux) VMs for free for OSS projects. They currently do not support nested virtualization but this pull request from a Microsoftie is inside this repo they use for generating the images they are using for their service is switching the instance type they are using for building to something that supports nested virtualization. It's un-merged but it's safe to say they're thinking of introducing support for it. Barring that, Azure Pipelines is most likely to have available the in-between non-LTSC builds of Windows such as |
We might have more combinations in the future as well. Like #14 which could double or triple the amount of images. |
I don't have strong preferences on the CI setup - but presumably the other official image repos that have Windows images should have something to base the work here off of? |
Definitely, there's some things to learn from them. Using the go and python Windows images as reference, I've found the following.
In the meantime, I've also discovered that simply rebasing some of the GNU images atop of So here's my TODO list:
Maybe after all this it might be PR ready. We'll see. |
Alright! I got it refactored to that scheme. I got a hardcoded https://dev.azure.com/nelsonjchen/docker-rust/_build/results?buildId=15 In the meantime, while hardcoding it, I think there's some issue with the |
Just a quick check to see if there's been any movement on this front as time has gone by. |
Have we made any progress on this issue these years? |
I think the main issue is no one seems to use windows containers. If they did there might be more movement, but the use case is lacking at the moment. |
As someone who uses Windows containers, there's dozens of us! Dozens! Jokes out of the way, for my job I am currently creating Windows containers for Rust. I would rather not have to make them myself, but seeing how long this issue has been around and how long the beta issue has been around, I don't think that will be changing any time soon. |
I mean, the only thing blocking this issue is someone getting a Dockerfile that works. If you have those, then feel free to open a PR. |
I was under the impression that there was more needed than just some dockerfiles, but if that is truly all that's needed I'll submit a PR ASAP. |
@yodaldevoid I see you made some progress in https://github.com/yodaldevoid/rust-windows. Can we expect a PR from you? |
Welp, it seems ASAP was two months. Sorry about that, world's been a bit crazy. Anywho, I've opened #71 with what I've got so far. I'll probably tomorrow to throw together an Azure, Appveyor, or GitHub Actions pipeline from other's previous work. I don't really have any personal stake in getting the GNU toolchains working, but maybe I'll get inspired. |
Thanks a lot! |
For anyone coming here who just wants Windows support to be able to use a compile stage in their Dockerfile for creating a Windows container image: You can also cross-build a Windows container image on Linux for a Rust application: |
Are there any plans to get official Windows Server images? Preferably based of
microsoft/windowsservercore
image?The text was updated successfully, but these errors were encountered: