Web lists-archives.com

Cygwin Docker image


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

Here is the Dockerfile I have (can also be viewed in

    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
        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,

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