Created
November 2, 2020 22:28
-
-
Save paleozogt/fbf2fccc06cc26c73b2b6c14b5504797 to your computer and use it in GitHub Desktop.
cygwin in docker workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# escape=` | |
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 | |
SHELL ["cmd", "/S", "/C"] | |
# chocolatey package manager | |
ADD https://chocolatey.org/install.ps1 install.ps1 | |
RUN powershell ./install.ps1 | |
# cygwin and its package manager | |
# (note that cygwin makes WSL symlinks, which aren't supported | |
# by windows docker yet, so we convert them to regular windows symlinks) | |
ARG CYGWIN_HOME=C:\tools\cygwin | |
RUN choco install --no-progress -y cygwin cyg-get && ` | |
cd %CYGWIN_HOME%\dev && ` | |
del fd && mklink fd "%CYGWIN_HOME%/proc/self/fd" && ` | |
del stdin && mklink stdin "%CYGWIN_HOME%/proc/self/fd/0" && ` | |
del stdout && mklink stdout "%CYGWIN_HOME%/proc/self/fd/1" && ` | |
del stderr && mklink stderr "%CYGWIN_HOME%/proc/self/fd/2" && ` | |
` | |
cd %CYGWIN_HOME%\etc && ` | |
del hosts && mklink hosts "%WINDIR%\System32\drivers\etc\hosts" && ` | |
del mtab && mklink mtab "%CYGWIN_HOME%/proc/mounts" && ` | |
del networks && mklink networks "%WINDIR%\System32\drivers\etc\networks" && ` | |
del protocols && mklink protocols "%WINDIR%\System32\drivers\etc\protocol" && ` | |
del services && mklink services "%WINDIR%\System32\drivers\etc\services" && ` | |
` | |
cd %CYGWIN_HOME%\etc\pki\ca-trust\source && ` | |
del ca-bundle.legacy.crt && mklink ca-bundle.legacy.crt "%CYGWIN_HOME%/usr/share/pki/ca-trust-legacy/ca-bundle.legacy.default.crt" && ` | |
` | |
cd %CYGWIN_HOME%\etc\crypto-policies\back-ends && ` | |
del bind.config && mklink bind.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/bind.txt" && ` | |
del gnutls.config && mklink gnutls.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/gnutls.txt" && ` | |
del java.config && mklink java.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/java.txt" && ` | |
del krb5.config && mklink krb5.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/krb5.txt" && ` | |
del libreswan.config && mklink libreswan.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/libreswan.txt" && ` | |
del nss.config && mklink nss.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/nss.txt" && ` | |
del openssh.config && mklink openssh.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/openssh.txt" && ` | |
del opensshserver.config && mklink opensshserver.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/opensshserver.txt" && ` | |
del openssl.config && mklink openssl.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/openssl.txt" && ` | |
del opensslcnf.config && mklink opensslcnf.config "%CYGWIN_HOME%/usr/share/crypto-policies/DEFAULT/opensslcnf.txt" | |
# autoconf | |
# (note that cygwin makes WSL symlinks, which aren't supported | |
# by windows docker yet, so we convert them to regular windows symlinks) | |
RUN cyg-get automake make && ` | |
cd %CYGWIN_HOME%\bin && ` | |
del autoconf && mklink autoconf "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del autoheader && mklink autoheader "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del autom4te && mklink autom4te "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del autoreconf && mklink autoreconf "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del autoscan && mklink autoscan "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del autoupdate && mklink autoupdate "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
del ifnames && mklink ifnames "%CYGWIN_HOME%/usr/share/autotools/ac-wrapper.sh" && ` | |
cd %CYGWIN_HOME%\etc\alternatives && ` | |
del automake-doc && mklink automake-doc "%CYGWIN_HOME%/usr/share/info/automake1.9.info.gz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment