Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created March 29, 2017 09:07
Show Gist options
  • Save rsdy/1a3b418f45800afa738b6a0bbe08f7d3 to your computer and use it in GitHub Desktop.
Save rsdy/1a3b418f45800afa738b6a0bbe08f7d3 to your computer and use it in GitHub Desktop.
Rust musl builder container
FROM ubuntu:16.04
RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install curl build-essential cmake libssl-dev xutils-dev musl-tools && \
ln -s /usr/bin/g++ /usr/bin/musl-g++ && \
useradd build && \
mkdir -p /home/build && \
chown -R build:build /home/build
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN /root/.cargo/bin/rustup target add x86_64-unknown-linux-musl
ENV PATH=$PATH:/home/build/.cargo/bin:/root/.cargo/bin
WORKDIR /home/build/code
CMD cargo build --release --target=x86_64-unknown-linux-musl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment