FROM ubuntu:18.04 ARG DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / RUN /common.sh COPY cmake.sh / RUN /cmake.sh COPY xargo.sh / RUN /xargo.sh RUN dpkg --add-architecture i386 && apt-get update && \ apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev COPY wine.sh / RUN /wine.sh # Build mingw tools using dwarf exceptions COPY mingw.sh / RUN bash mingw.sh # run-detectors are responsible for calling the correct interpreter for exe # files. For some reason it does not work inside a docker container (it works # fine in the host). So we replace the usual paths of run-detectors to run wine # directly. This only affects the guest, we are not messing up with the host. # # See /usr/share/doc/binfmt-support/detectors RUN mkdir -p /usr/lib/binfmt-support/ && \ rm -f /usr/lib/binfmt-support/run-detectors /usr/bin/run-detectors && \ ln -s /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \ ln -s /usr/bin/wine /usr/bin/run-detectors COPY windows-entry.sh / ENTRYPOINT ["/windows-entry.sh"] ENV CARGO_TARGET_I686_PC_WINDOWS_GNU_LINKER=i686-w64-mingw32-gcc \ CARGO_TARGET_I686_PC_WINDOWS_GNU_RUNNER=wine \ CC_i686_pc_windows_gnu=i686-w64-mingw32-gcc-posix \ CXX_i686_pc_windows_gnu=i686-w64-mingw32-g++-posix \ BINDGEN_EXTRA_CLANG_ARGS_i686_pc_windows_gnu="--sysroot=/usr/i686-w64-mingw32"