Skip to content

Instantly share code, notes, and snippets.

Last active August 15, 2022 22:56
What would you like to do?
LibAFL Windows Dockerfile
# escape=`
# Restore the default Windows shell for correct batch processing
SHELL ["cmd", "/S", "/C"]
RUN curl -SL --output vs_buildtools.exe
# Install the relevant components via their IDs
RUN start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.VisualStudio.Component.VC.CMake.Project `
--add Microsoft.VisualStudio.Component.VC.ATL `
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
--add Microsoft.VisualStudio.Component.TestTools.BuildTools
# Install chocolatey
ENV chocolateyUseWindowsCompression false
RUN powershell -Command `
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))
# Install python3 via chocolatey
RUN choco install -y python3
# Install git via chocolatey
RUN choco install -y git
# Install 7zip via chocolatey
RUN choco install -y 7zip.install
# Install rust
RUN curl -SL -o rustup-init.exe
RUN .\\rustup-init.exe -y
# Tell rustc to link against the libcmt.lib static runtime (applicable on windows only).
# There is some duplicate symbol weirdness when using asan and linking against the msvcrt.lib dynamic runtime.
ENV RUSTFLAGS '-C target-feature=+crt-static'
# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment