Skip to content

Instantly share code, notes, and snippets.

@andyli
Created October 8, 2017 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyli/0fc84d60bf29b54b8213fba8ff7d8d24 to your computer and use it in GitHub Desktop.
Save andyli/0fc84d60bf29b54b8213fba8ff7d8d24 to your computer and use it in GitHub Desktop.
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN $url = 'https://cygwin.com/setup-x86_64.exe'; \
Write-Host ('Downloading {0} ...' -f $url); \
Invoke-WebRequest -Uri $url -OutFile 'C:/setup-x86_64.exe'; \
\
Write-Host 'Installing ...'; \
New-Item -ItemType directory -Path 'C:/tmp'; \
Start-Process "C:/setup-x86_64.exe" -NoNewWindow -Wait -PassThru -ArgumentList @('-q','-v','-n','-B','-R','C:/cygwin64','-l','C:/tmp','-s','http://mirror.pkill.info/cygwin/','-P','default'); \
\
Write-Host 'Removing ...'; \
Remove-Item -Path 'C:/tmp' -Force -Recurse -ErrorAction Ignore; \
\
Write-Host 'Verifying install ...'; \
Start-Process "C:/cygwin64/bin/cygcheck.exe" -NoNewWindow -Wait -PassThru -ArgumentList @('-c'); \
\
Write-Host 'Complete.';
CMD ["C:/cygwin64/bin/bash.exe"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment