Skip to content

Commit

Permalink
cleanup Windows docker file test; and workaround issue with cygwin no…
Browse files Browse the repository at this point in the history
…t working on latest docker (moby/moby#41058 (comment))
  • Loading branch information
LewisPringle committed Jul 29, 2020
1 parent 4f40f19 commit 4c2d648
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 62 deletions.
5 changes: 4 additions & 1 deletion DockerBuildContainers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ ifeq ($(shell uname),Linux)
docker build -f Stroika-Dev/Dockerfile -t sophistsolutionsinc/stroika-dev .
endif
ifeq (Windows,$(findstring Windows,$(OS)))
docker build -f Windows-Cygwin-VS2k19/Dockerfile -t sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k19 .
# to build this you may need --storage-opts "size 100GB", but that currently doesn't work with build, so set
# in docker windows configuration settings (can get from docker gui - settings/Docker Engine)
# Build with -m 4GB cuz default of 1GB pages alot
docker build -m 4GB -f Windows-Cygwin-VS2k19/Dockerfile -t sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k19 .
#docker build -f Windows-MinGW-VS2k19/Dockerfile -t sophistsolutionsinc/stroika-buildvm-windows-mingw-vs2k19 .
endif

Expand Down
35 changes: 26 additions & 9 deletions DockerBuildContainers/Windows-Cygwin-VS2k19/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# escape=`

# SEE https://hub.docker.com/_/microsoft-windows-servercore for list of versions
#ARG BASE_IMAGE=mcr.microsoft.com/windows/servercore:2004
ARG BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2019
FROM ${BASE_IMAGE}
SHELL ["powershell"]


#
# List of workloads and components to add from
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?vs-2019&view=vs-2019
#
# --add Microsoft.VisualStudio.Component.VC.CoreBuildTools `
# --add Microsoft.VisualStudio.Component.UniversalBuildTools `
# --add Microsoft.VisualStudio.Component.VC.ATLMFC `
#

Expand All @@ -21,36 +23,51 @@ ARG VS_Latest=https://aka.ms/vs/16/release/vs_buildtools.exe
ARG VS_16_4_6=https://download.visualstudio.microsoft.com/download/pr/5714a1fb-d8a9-4e24-b6b7-c1a40a001d4c/f68093ddf8d523354d63ac326697473c98439c92c7df09159fe974ea6622b2f5/vs_BuildTools.exe
ARG VS_16_5_5=https://download.visualstudio.microsoft.com/download/pr/68d6b204-9df0-4fcc-abcc-08ee0eff9cb2/17af83ed545d1287df7575786c326009e459708b60a6821d2a4f5606ef8efb9e/vs_BuildTools.exe
ARG VS_16_6_0=https://download.visualstudio.microsoft.com/download/pr/0fed0c12-ccd3-4767-b151-a616aaf99d86/2d180d9c6b8d24f38a88301652581793353d0ffa0d9f04f6dff5ad26d720a97b/vs_BuildTools.exe
ARG VS_16_6_4=https://download.visualstudio.microsoft.com/download/pr/c10c95d2-4fba-4858-a1aa-c3b4951c244b/3cd935283a13a71acfdb5ee3ee413714e363207bed98351f377ba97abdb706fe/vs_BuildTools.exe
ARG VS_16_6_5=https://download.visualstudio.microsoft.com/download/pr/067fd8d0-753e-4161-8780-dfa3e577839e/4776935864d08e66183acd5b3647c9616da989c60afbfe100d4afc459f7e5785/vs_BuildTools.exe

RUN Invoke-WebRequest "$env:VS_16_6_0" `
SHELL ["powershell"]
RUN Invoke-WebRequest "$env:VS_16_6_5" `
-OutFile "$env:TEMP\vs_buildtools.exe" -UseBasicParsing
RUN & "$env:TEMP\vs_buildtools.exe" `
SHELL ["cmd", "/S", "/C"]
RUN %TEMP%\vs_buildtools.exe `
--add Microsoft.VisualStudio.Workload.VCTools `
--add Microsoft.VisualStudio.Workload.UniversalBuildTools `
--add Microsoft.VisualStudio.Component.VC.ATLMFC `
--includeRecommended `
--quiet --wait --norestart --noUpdateInstaller `
| Out-Default
# || IF "%ERRORLEVEL%"=="3010" EXIT 0
|| IF "%ERRORLEVEL%"=="3010" EXIT 0


# choco
SHELL ["powershell"]
RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

RUN choco install -y cyg-get
RUN cyg-get default make unzip git wget patch pkg-config dos2unix p7zip
### WORKAROUND DOCKER/CYGWIN issue/regression
### https://github.com/moby/moby/issues/41058#issuecomment-653865175
###
### use cygwinsetup instead of choco intall / cyg-get
SHELL ["cmd", "/S", "/C"]
RUN md c:\tools\cygwin && cd c:\tools\cygwin && curl -Sso cygwinsetup.exe https://cygwin.com/setup-x86_64.exe && start /wait cygwinsetup -q --root C:\tools\cygwin -P default,make,unzip,git,wget,patch,pkg-config,dos2unix,p7zip -X --site http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2020/05/31/142136/

#RUN choco install -y cyg-get
#RUN cyg-get default make unzip git wget patch pkg-config dos2unix p7zip

## Sometimes helpful
## cyg-get gdb
SHELL ["powershell"]
RUN `
$env:PATH = $env:PATH + ';c:\tools\cygwin\bin'; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);

COPY Windows-Cygwin-VS2k19/Getting-Started-With-Stroika.md ./
COPY Windows-Cygwin-VS2k19/FixupPath.bat ./

# Note, tried using ENTRYPOINT, but this doesn't seem to work reasonably with docker, and mcuh worse with windows (in part due to available shell commands)
# Note, tried using ENTRYPOINT, but this doesn't seem to work reasonably with docker,
# and much worse with windows (in part due to available shell commands)
CMD ["cmd", "/c", "call FixupPath.bat && echo see Getting-Started-With-Stroika.md && cmd"]

### NOTE TO RUN
### docker run -v c:\Sandbox:c:\Sandbox -it sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k19
### docker run -it --storage-opt "size=100GB" sophistsolutionsinc/stroika-buildvm-windows-cygwin-vs2k19
### see ScriptsLib/RunLocalWindowsDockerRegressionTests
### see ScriptsLib/RunLocalWindowsDockerRegressionTests

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ make CONFIGURATION=Debug-U-32 all -j4
## Make all configurations

make all -j4

for now, not enuf disk space on windows docker containers, and broken resetting size

0 comments on commit 4c2d648

Please sign in to comment.