Skip to content

Build of an MSYS2 image fails #601

@raffapen

Description

@raffapen

Describe the bug

Building an image that contains an MSYS2 installation (using the Dockerfile specified below) fails with the following message:

re-exec error: exit status 1: output: hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3)

To Reproduce

With the following Dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2025

SHELL ["powershell", "-Command"]

WORKDIR /tmp
RUN irm -outfile msys2-sfx.exe https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe

WORKDIR /
RUN c:\\tmp\\msys2-sfx.exe

ENV HOME=/home/ContainerAdministrator
ENV MSYS=winsymlinks:native
ENV TZ=America/New_York

RUN C:\\msys64\\usr\\bin\\bash.exe -l -c /usr/bin/true

ENTRYPOINT ["C:\\msys64\\usr\\bin\\bash.exe", "-l"]

Execute: docker build -t msys2-nightly:2025 .

Expected behavior

The image should be created successfully.

Configuration:

  • Edition: Windows 11 Pro 24H2 26100.2605
  • Base Image being used: mcr.microsoft.com/windows/servercore:ltsc2025
  • Container engine: Docker
  • Docker Desktop version: v4.41.2
  • Container Engine version: Docker version 28.1.1, build 4eba377

Additional context

When modifying the Dockerfile to:

FROM mcr.microsoft.com/windows/servercore:ltsc2025

SHELL ["powershell", "-Command"]

WORKDIR /tmp
RUN irm -outfile msys2-sfx.exe https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe

WORKDIR /
RUN c:\\tmp\\msys2-sfx.exe

ENV HOME=/home/ContainerAdministrator
ENV MSYS=winsymlinks:native
ENV TZ=America/New_York

CMD ["powershell"]

the build completes successfully.
Then, the following operation yield the same result as the original build:

  • Creating the container via docker run -it msys2-nightly:2025
  • Running C:\\msys64\\usr\\bin\\bash.exe -l -c /usr/bin/true inside the container
  • Exiting the container and inspecting the container ID via docker ps -a
  • Trying to commit: docker commit <SHA> msys2-nightly-1:2025

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions