public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin Docker image
@ 2017-10-08 16:02 Andy Li
  0 siblings, 0 replies; only message in thread
From: Andy Li @ 2017-10-08 16:02 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-08 16:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-08 16:02 Cygwin Docker image Andy Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).