From 62809a9d4fdedf1678a6d8d7d4613326f4a1c843 Mon Sep 17 00:00:00 2001 From: "Franc[e]sco" Date: Tue, 3 Oct 2017 05:40:00 +0200 Subject: [PATCH] add windows docker container --- build_containers.ps1 | 7 +++++++ docker/windows/Dockerfile | 26 ++++++++++++++++++++++++++ package.ps1 | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 build_containers.ps1 create mode 100644 docker/windows/Dockerfile create mode 100644 package.ps1 diff --git a/build_containers.ps1 b/build_containers.ps1 new file mode 100644 index 0000000..4023bc1 --- /dev/null +++ b/build_containers.ps1 @@ -0,0 +1,7 @@ +$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition +Push-Location "$dir" +$d = "docker/windows" +Copy-Item $d/Dockerfile . +docker build -t "oppai-ng:windows" . +Remove-Item Dockerfile +Pop-Location \ No newline at end of file diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile new file mode 100644 index 0000000..eb67773 --- /dev/null +++ b/docker/windows/Dockerfile @@ -0,0 +1,26 @@ +# escape=` + +# I wanted to use nanoserver but I couldn't get visual c++ build +# tools to install. the nuget visual c++ build tools package isn't +# enough to get a working compiler and manually copying msvc +# defeats the purpose of using the container to automatically +# install deps. +# unfortunately windowsservercore is a 4GB image +FROM microsoft/windowsservercore + +RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + +# wait for vs_installer.exe, vs_installerservice.exe +# or vs_installershell.exe because choco doesn't +RUN powershell -NoProfile -InputFormat None -Command ` + choco install git 7zip -y; ` + choco install visualcpp-build-tools ` + --version 15.0.26228.20170424 -y; ` + Write-Host 'Waiting for Visual C++ Build Tools to finish'; ` + Wait-Process -Name vs_installer + +WORKDIR C:\oppai-ng +CMD powershell -ExecutionPolicy Bypass -Command ` + Get-Location; Get-ChildItem; ` + . .\vcvarsall17.ps1 x64; .\release.ps1; ` + . .\vcvarsall17.ps1 x86; .\release.ps1 \ No newline at end of file diff --git a/package.ps1 b/package.ps1 new file mode 100644 index 0000000..01a271b --- /dev/null +++ b/package.ps1 @@ -0,0 +1,4 @@ +$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition +Push-Location $dir +docker run --rm -v ${dir}:c:\oppai-ng oppai-ng:windows +Pop-Location \ No newline at end of file