This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 = ''; \
        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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]