FROM ubuntu:16.04 RUN apt-get update \ && apt-get install -y --no-install-recommends \ build-essential \ curl \ gcc-aarch64-linux-gnu \ gcc-arm-linux-gnueabihf \ libc6-dev-arm64-cross \ libc6-dev-armhf-cross \ libc6-dev-i386 \ gcc-5-multilib \ asciidoctor \ musl musl-dev musl-tools \ && rm -rf /var/cache/dpkg RUN ln -s asm-generic/ /usr/include/asm RUN useradd -ms /bin/bash user USER user WORKDIR /home/user ENV RUST=1.50.0 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST} ENV PATH=/home/user/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN rustup target add i686-unknown-linux-gnu \ && rustup target add armv7-unknown-linux-gnueabihf \ && rustup target add aarch64-unknown-linux-gnu \ && rustup target add x86_64-unknown-linux-musl \ && rustup target add i686-unknown-linux-musl \ && rustup target add armv7-unknown-linux-musleabihf \ && rustup target add aarch64-unknown-linux-musl RUN cargo install cargo-deb \ && rm -rf /home/user/.cargo/{git,tmp,registry} ENV UPX_VER=3.96 RUN curl https://github.com/upx/upx/releases/download/v${UPX_VER}/upx-${UPX_VER}-amd64_linux.tar.xz -Lf | tar -xJ --strip-components=1 -C /home/user/.cargo/bin VOLUME /home/user/.cargo/tmp VOLUME /home/user/.cargo/git VOLUME /home/user/.cargo/registry