|
| 1 | +# Windows build environment for rust crates |
| 2 | + |
| 3 | +This repository contains the source of a Docker container the Rust project uses |
| 4 | +to build third-party crates on Windows. It is based on **Windows Server Core, |
| 5 | +version 1803**, and contains all the native dependencies used by the Rust |
| 6 | +crates we know of. |
| 7 | + |
| 8 | +## Dependencies |
| 9 | + |
| 10 | +All dependencies listed in `vc-packages.txt` will be installed into the |
| 11 | +image with `vcpkg`. |
| 12 | + |
| 13 | +## Using the docker image |
| 14 | + |
| 15 | +This image must be run on a Windows host with both containerization and Hyper-V |
| 16 | +enabled (Windows 10 Pro or Windows Server >=2016). If you wish to run `crater` |
| 17 | +on an Azure VM, this requires a virtual machine image tagged with "v3". |
| 18 | + |
| 19 | + |
| 20 | +Hyper-V can be enabled in [the GUI][hyperv] or in `Powershell` with: |
| 21 | + |
| 22 | +```powershell |
| 23 | +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All |
| 24 | +``` |
| 25 | + |
| 26 | +A reboot is required for this to take effect. |
| 27 | + |
| 28 | +[hyperv]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v#enable-the-hyper-v-role-through-settings |
| 29 | + |
| 30 | + |
| 31 | +The Docker host must have a [build number][build] equal to that of the image |
| 32 | +you wish to run (presently `mcr.microsoft.com/windows/servercore:1803`). |
| 33 | + |
| 34 | +[Docker Desktop][] is required to run native Windows containers; this image |
| 35 | +will not work with Docker Toolbox. Once installed, ensure that Docker Desktop |
| 36 | +is configured to run Windows containers by right-clicking the icon in the |
| 37 | +dock, or by running the following in `Powershell`: |
| 38 | + |
| 39 | +```powershell |
| 40 | +$Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon . |
| 41 | +``` |
| 42 | + |
| 43 | +[Docker Desktop]: https://hub.docker.com/editions/community/docker-ce-desktop-windows |
| 44 | +[build]: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility |
0 commit comments