├── msys2 ├── msys2 └── Dockerfile ├── devcontainer └── Dockerfile ├── .devcontainer └── devcontainer.json ├── LICENSE ├── README.md └── .github └── workflows └── main.yml /msys2/msys2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | WINEDEBUG="-all" WINEPATH="C:\\msys64\\usr\\bin" MSYSTEM="${MSYSTEM:-UCRT64}" xvfb-run -a wine bash.exe -l "$@" 4 | -------------------------------------------------------------------------------- /devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/msys2/msys2-docker-experimental 2 | 3 | RUN apt update \ 4 | && apt install -y git \ 5 | && rm -rf /var/lib/apt/lists/* 6 | 7 | RUN msys2 -c "pacman -S --noconfirm --needed git base-devel" 8 | 9 | # Link in the by codespaces injected git config, 10 | # to make the git work in MSYS2 too 11 | RUN ln -s /etc/gitconfig ~/.wine/drive_c/msys64/etc/gitconfig 12 | RUN ln -s /.codespaces ~/.wine/drive_c/msys64/.codespaces 13 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "ghcr.io/msys2/msys2-docker-devcontainer", 3 | "customizations": { 4 | "vscode": { 5 | "settings": { 6 | "terminal.integrated.defaultProfile.linux": "MSYS2-UCRT64", 7 | "terminal.integrated.profiles.linux": { 8 | "MSYS2-UCRT64": { 9 | "path": "msys2", 10 | "env": { 11 | "MSYSTEM": "UCRT64" 12 | } 13 | }, 14 | "MSYS2-CLANG64": { 15 | "path": "msys2", 16 | "env": { 17 | "MSYSTEM": "CLANG64" 18 | } 19 | }, 20 | "MSYS2-MSYS": { 21 | "path": "msys2", 22 | "env": { 23 | "MSYSTEM": "MSYS" 24 | } 25 | } 26 | } 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Christoph Reiter. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MSYS2 Docker Images (Experimental) 2 | 3 | This repository provides Docker images including MSYS2. 4 | 5 | ## Linux & Wine 6 | 7 | **WARNING:** Package and database signature checks are currently disabled to 8 | speed up the build process. This Docker image is not recommended for production 9 | use. 10 | 11 | Simply run the image to get a shell: 12 | 13 | ```console 14 | $ docker run -it ghcr.io/msys2/msys2-docker-experimental 15 | D406664E7A3F+root@d406664e7a3f UCRT64 ~ 16 | # uname -a 17 | MINGW64_NT-10.0-19043 d406664e7a3f 3.4.10.x86_64 2024-04-08 18:11 UTC x86_64 Msys 18 | ``` 19 | 20 | It defaults to the `UCRT64` environment. Pass `-eMSYSTEM=CLANG64` etc to change the default environment. 21 | 22 | Or alternatively use the included `msys2` command which runs bash: 23 | 24 | ```console 25 | $ docker run -it ghcr.io/msys2/msys2-docker-experimental msys2 -c "uname -a" 26 | MINGW64_NT-10.0-19043 51eee8aa4763 3.4.10.x86_64 2024-04-08 18:11 UTC x86_64 Msys 27 | ``` 28 | 29 | Acknowledgments: 30 | 31 | * The Dockerfile is inspired by the following 32 | [Dockerfile](https://github.com/pojntfx/hydrapp/blob/main/hydrapp/pkg/builders/msi/Dockerfile) 33 | by [@pojntfx (Felicitas Pojtinger)](https://github.com/pojntfx) 34 | * The [Wine fork](https://gitlab.winehq.org/jhol/wine) including the necessary 35 | MSYS2/Cygwin specific changes is developed by [@jhol (Joel 36 | Holdsworth)](https://github.com/jhol) 37 | 38 | ## Windows 39 | 40 | Would they be useful? Let us know. 41 | 42 | ## License 43 | 44 | Everything in this repository is licensed under the 45 | [BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html) License unless 46 | otherwise noted. 47 | -------------------------------------------------------------------------------- /msys2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/msys2/msys2-docker-build-base AS build 2 | 3 | # Install MSYS2 4 | RUN apt update && apt install -y zstd curl 5 | RUN mkdir -p /tmp/msys64 6 | RUN curl --fail -L 'https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.tar.zst' | tar -x --zstd -C /tmp/ 7 | 8 | FROM debian:bookworm 9 | 10 | # Copy over wine and install the runtime deps 11 | RUN apt update \ 12 | && apt install -y --no-install-recommends xvfb wine64 xauth \ 13 | && apt remove -y wine64 libwine \ 14 | && rm -rf /var/lib/apt/lists/* 15 | COPY --from=build /wine / 16 | RUN ldconfig 17 | 18 | # XXX: otherwise things hang 19 | RUN winecfg 20 | 21 | # Copy over MSYS2 22 | COPY --from=build /tmp/msys64 /root/.wine/drive_c/msys64 23 | 24 | # XXX: Signature validation is too slow, so disable it for now 25 | # To keep the impact of this change lower, we only allow the main mirror 26 | RUN sed -i /root/.wine/drive_c/msys64/etc/pacman.conf -e 's/SigLevel = Required/SigLevel = Never/g' 27 | RUN echo 'Server = https://repo.msys2.org/msys/$arch/' > /root/.wine/drive_c/msys64/etc/pacman.d/mirrorlist.msys 28 | RUN echo 'Server = https://repo.msys2.org/mingw/$repo/' > /root/.wine/drive_c/msys64/etc/pacman.d/mirrorlist.mingw 29 | 30 | # Not strictly necessary, let's skip it for now 31 | RUN sed -i 's/--refresh-keys/--version/g' '/root/.wine/drive_c/msys64/etc/post-install/07-pacman-key.post' 32 | 33 | # Disable space checks to speed up package installation 34 | RUN sed -i /root/.wine/drive_c/msys64/etc/pacman.conf -e 's/^CheckSpace/#CheckSpace/g' 35 | 36 | COPY ./msys2 /usr/bin/msys2 37 | RUN chmod +x /usr/bin/msys2 38 | 39 | # Run for the first time 40 | RUN msys2 -c " " 41 | 42 | WORKDIR /root/.wine/drive_c/msys64/home/root 43 | CMD ["msys2"] 44 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | workflow_dispatch: 5 | branches: 6 | - "main" 7 | pull_request: 8 | branches: 9 | - "main" 10 | schedule: 11 | - cron: '0 0 1 * *' 12 | 13 | jobs: 14 | build: 15 | permissions: 16 | contents: read 17 | packages: write 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v4 21 | 22 | - name: Log in 23 | if: github.event_name != 'pull_request' 24 | run: | 25 | echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin 26 | env: 27 | TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | USERNAME: ${{ github.actor }} 29 | 30 | - name: Build build base image 31 | if: github.event_name != 'schedule' 32 | run: | 33 | docker build --tag ghcr.io/msys2/msys2-docker-build-base:latest ./build-base 34 | 35 | - name: Build images 36 | run: | 37 | docker build --tag ghcr.io/msys2/msys2-docker-experimental:latest ./msys2 38 | docker build --tag ghcr.io/msys2/msys2-docker-devcontainer:latest ./devcontainer 39 | 40 | - name: Save images 41 | if: github.event_name == 'pull_request' 42 | run: | 43 | docker image save ghcr.io/msys2/msys2-docker-experimental:latest | zstd -T0 -c > experimental.tar.zst 44 | docker image save ghcr.io/msys2/msys2-docker-devcontainer:latest | zstd -T0 -c > devcontainer.tar.zst 45 | 46 | - name: Upload artifacts 47 | uses: actions/upload-artifact@v4 48 | if: github.event_name == 'pull_request' 49 | with: 50 | name: docker-images 51 | path: '*.tar.zst' 52 | 53 | - name: Deploy build base image 54 | if: github.event_name != 'pull_request' && github.event_name != 'schedule' 55 | run: | 56 | docker push ghcr.io/msys2/msys2-docker-build-base:latest 57 | 58 | - name: Deploy images 59 | if: github.event_name != 'pull_request' 60 | run: | 61 | docker push ghcr.io/msys2/msys2-docker-experimental:latest 62 | docker push ghcr.io/msys2/msys2-docker-devcontainer:latest 63 | --------------------------------------------------------------------------------