An update. I had a lot of fun looking at containers for WDK and I am very impressed with Docker. I was able to put together a first version of a “windowsdriverkit1803” container.
How:
* I followed the instructions posted on https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container
* However I used an updated Dockerfile (see bottom of this post)
* The update Dockerfile does following:
* Installs the WDK (including a rather hacky installation of the WDK.vsix)
* Installs git
* Finally clones the Windows Driver Samples git repo.
You build the container all as follows:
docker build -t windowsdriverkit1803:latest -m 2GB .
First time the build took hours. Later builds are due to the Docker caching running in a few seconds.
Once built I could launch the container and build one of our sample drivers from inside the container:
docker run -it windowsdriverkit1803
cd “C:\Windows-driver-samples\tools\sdv\samples\SDV-FailDriver-WDM”
msbuild
Next steps: This is largely untested and there are still lots of thing to look and refine/fix. For example (and as mentioned in my first post) API Validator does not work. We’ll look at that later. But in the interest of sharing I thought it useful to post our progress. Thanks lots to Adonais from our team helping me put this together.
Best,
Jakob
Here follows the Dockerfile:
escape=`
Use the latest Windows Server Core image with .NET Framework 4.7.1.
FROM microsoft/dotnet-framework:4.7.1
Download the Build Tools bootstrapper.
ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
Install Build Tools excluding workloads and components with known issues.
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache --installPath C:\BuildTools
–all --remove Microsoft.VisualStudio.Component.Windows10SDK.10240
–remove Microsoft.VisualStudio.Component.Windows10SDK.10586 --remove Microsoft.VisualStudio.Component.Windows10SDK.14393
–remove Microsoft.VisualStudio.Component.Windows81SDK `
|| IF “%ERRORLEVEL%”==“3010” EXIT 0
Download the WDK bootstrapper.
ADD https://go.microsoft.com/fwlink/?linkid=873060 C:\TEMP\wdksetup.exe
Install WDK excluding WDK.vsix.
RUN C:\TEMP\wdksetup.exe /q
Install WDK.vsix in manual manner.
RUN copy “C:\Program Files (x86)\Windows Kits\10\Vsix\WDK.vsix” C:\TEMP\wdkvsix.zip
RUN powershell Expand-Archive C:\TEMP\wdkvsix.zip -DestinationPath C:\TEMP\wdkvsix
RUN robocopy /e “C:\TEMP\wdkvsix$VCTargets\Platforms” “C:\BuildTools\Common7\IDE\VC\VCTargets\Platforms” || EXIT 0
Download GIT.
ADD https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/MinGit-2.18.0-64-bit.zip C:\TEMP\MinGit.zip
RUN powershell Expand-Archive C:\TEMP\MinGit.zip -DestinationPath C:\MinGit
Clone Windows-driver-samples git repo.
RUN C:\MinGit\cmd\git.exe clone https://github.com/Microsoft/Windows-driver-samples.git
Start developer command prompt with any other commands specified.
ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat &&