Web lists-archives.com

Cygwin Docker image




Hi,

I'm trying to create a Cygwin Docker image, in order to have a
completely isolated Cygwin environment.

I'm able to install Cygwin in the Windows Server Core image, but the
installed bash.exe exits immediately when I run it. The exit code is
0, so I suppose it is not a crash. Do you have any idea why this
happen?

Here is the Dockerfile I have (can also be viewed in
https://gist.github.com/andyli/0fc84d60bf29b54b8213fba8ff7d8d24/44a6e02aa340baa721c2707095d7143127544fd8#file-dockerfile):

    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"]

To build it, run
   docker build -t cygwin .

To create a container and start cmd:
   docker run -it --rm cygwin cmd

Any help is appreciated.

Best regards,
Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple