Docker Community Forums

Share and learn in the Docker community.

Cygwin not working inside the windows 2016 container

We have requirement of cygwin installed inside container. I was able to get cygwin installed inside container and all the required packages are also installed inside container. However while invoking any commands for eg: ‘ls’ it doesn’t return any output.

I see posts regarding this as below but it is closed with out a valid suggestion. Did any one installed cygwin inside windows container and able to get it working.
A high level view of my docker file is as below.

FROM microsoft/windowsservercore
RUN cmd.exe /c mkdir c:\\cygwin
COPY ["cygwin_install.bat", "c:/cygwin_distr/cygwin_install.bat"]
COPY ["setup-x86_64.exe", "c:/cygwin_distr/setup-x86_64.exe"]
COPY ["extra_packages.txt", "c:/cygwin_distr/extra_packages.txt"]
COPY ["", "c:/cygwin_distr/"]
VOLUME c:\\docker
WORKDIR c:\\cygwin_distr
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \	
Expand-Archive -Path c:/cygwin_distr/ -DestinationPath c:/cygwin_distr/package/ ;
RUN cmd.exe /c  c:/cygwin_distr/cygwin_install.bat

The issue you describe with missing output from e.g. ls in cygwin seems related to this issue where a few guys have been poking a bit deeper on something similar:

Sorry, they didn’t resolve it - yet - but the issue is still open and IMO contains something to work with