MSYS2 in a Windows container
See original GitHub issueHi Stefan,
your examples and tips are great help for me.
I’m trying to build a Windows container with MSYS2 I was able to build an image based on windowsservercore. I have created a dockerfile, which downloads and installs 7z, and the latest MSYS2 tar, and extracts it:
FROM microsoft/windowsservercore
# Make sure we're in temp for the downloads
WORKDIR c:/windows/temp
# Switch to PowerShell
SHELL ["powershell", "-command"]
RUN Invoke-WebRequest -UserAgent 'DockerCI' -outfile 7zsetup.exe http://www.7-zip.org/a/7z1604-x64.exe
RUN Invoke-WebRequest -UserAgent 'DockerCI' -outfile msys2-x86_64-latest.tar.xz http://repo.msys2.org/distrib/msys2-x86_64-latest.tar.xz
RUN Start-Process .\7zsetup -ArgumentList '/S /D=c:/7zip' -Wait
RUN C:\7zip\7z e msys2-x86_64-latest.tar.xz -Wait
RUN C:\7zip\7z x msys2-x86_64-latest.tar -o"C:\\"
RUN del *
#ENV PATH C:\msys64\usr\bin;C:\Windows;C:\Windows\System32
ENV MSYSTEM MSYS2
CMD powershell
So far so good. I can run the image with interactive shell - no problem:
docker run -it --rm msys2
Bur when I try to execute a simple command like
C:\msys64\usr\bin\pacman.exe --help
there is no message on the stdout
What is needed to see the stdout for MSYS2 binaries in an interactive shell?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:20 (12 by maintainers)
Top Results From Across the Web
Using MSYS2 in CI
Docker. Install MSYS2 under C:\msys64 into a Windows based Docker image: # select as base image ...
Read more >amitie10g/msys2 - Docker Image
MSYS2 container image. This is an attemp to bring the latest MSYS2 base (initial setup included) Microsoft® Windows® Server Core Docker image, ...
Read more >msys2 and docker run specifying the command - Stack Overflow
One workaround I've used is to create a new Dockerfile that just has a line to say to use the image I want...
Read more >JVM microservices - run Docker containers on Windows
Setup MSYS2 · Run installer from https://msys2.github.io/ and follow instructions · Use d:\opt\msys as a destination folder · After installation is ...
Read more >Get Started with C++ and Mingw-w64 in Visual Studio Code
Get the latest version of Mingw-w64 via MSYS2, which provides up-to-date native builds of GCC, Mingw-w64, and other helpful C++ tools and libraries....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just wanted to mention for reference purposes:
I have a use case for git in a Windows 10 Pro Docker Container. ssh and ssh utilities do not operate. Inspecting the container event log shows a crash occured in msys-2.0.dll (below). Any idea if there is a solution or workaround?