question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSYS2 in a Windows container

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
filipesilvacommented, Nov 15, 2018

Just wanted to mention for reference purposes:

0reactions
louisncommented, May 25, 2017

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?

ProviderName : Application Error Id : 1000 Message : Faulting application name: ssh-keygen.EXE, version: 0.0.0.0, time stamp: 0x0005dac8 Faulting module name: msys-2.0.dll, version: 2008.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x0000000000113bc5

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found