Skip to content

Instantly share code, notes, and snippets.

@drizzt
Last active December 5, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drizzt/fa4d62fc1118b387078bc06bd6c69009 to your computer and use it in GitHub Desktop.
Save drizzt/fa4d62fc1118b387078bc06bd6c69009 to your computer and use it in GitHub Desktop.
Dockerfile to build grin for Windows
# Usage:
# git clone --recurse --branch windows https://github.com/drizzt/grin.git
# cd grin
# wget -O Dockerfile https://gist.githubusercontent.com/drizzt/fa4d62fc1118b387078bc06bd6c69009/raw/Dockerfile
# docker build -t grin-mingw .
# docker run -ti --rm --user $(id -u) -v $PWD:/usr/src/grin grin-mingw
# ls target/x86_64-pc-windows-gnu/debug/grin.exe
FROM rust:latest
RUN set -ex && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 --no-install-recommends --yes install \
clang \
libclang-dev \
llvm-dev \
libncurses5 \
libncursesw5 \
cmake \
git \
mingw-w64 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/grin
ENV RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc -C ar=x86_64-w64-mingw32-ar"
ENV CARGO_HOME="/usr/src/grin/target/x86_64-pc-windows-gnu/.cargo"
# Installing Windows target
RUN rustup target add x86_64-pc-windows-gnu
# Building Grin
ENTRYPOINT ["cargo", "build", "--target", "x86_64-pc-windows-gnu"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment