2019-12-05 17:28:49 +00:00
|
|
|
FROM ubuntu:16.04
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
ARG TOOLCHAIN=stable
|
|
|
|
ARG UPX_VERSION=3.96
|
|
|
|
|
2019-03-01 15:37:43 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2020-01-24 13:26:23 +00:00
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
gcc-aarch64-linux-gnu \
|
|
|
|
gcc-arm-linux-gnueabihf \
|
|
|
|
libc6-dev-arm64-cross \
|
|
|
|
libc6-dev-armhf-cross \
|
2020-02-20 21:52:40 +00:00
|
|
|
libc6-dev-i386 \
|
|
|
|
gcc-5-multilib \
|
2020-06-03 15:42:43 +00:00
|
|
|
asciidoctor \
|
2021-02-22 15:19:19 +00:00
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
2020-02-20 21:52:40 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
ENV RUSTUP_HOME=/opt/rust/rustup \
|
|
|
|
PATH=/opt/rust/cargo/bin:/home/user/.cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN curl https://sh.rustup.rs -sSf | env CARGO_HOME=/opt/rust/cargo sh -s -- -y --default-toolchain ${TOOLCHAIN} --profile minimal --no-modify-path
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN env CARGO_HOME=/opt/rust/cargo rustup target add i686-unknown-linux-gnu \
|
|
|
|
&& env CARGO_HOME=/opt/rust/cargo rustup target add armv7-unknown-linux-gnueabihf \
|
|
|
|
&& env CARGO_HOME=/opt/rust/cargo rustup target add aarch64-unknown-linux-gnu
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN env CARGO_HOME=/opt/rust/cargo cargo install cargo-deb \
|
|
|
|
&& rm -rf /opt/rust/cargo/{git,tmp,registry}
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN ln -s asm-generic/ /usr/include/asm
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN useradd -ms /bin/bash user
|
|
|
|
USER user
|
|
|
|
WORKDIR /home/user
|
2019-03-01 15:37:43 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN mkdir -p /home/user/.cargo \
|
|
|
|
&& ln -s /opt/rust/cargo/config /home/user/.cargo/config
|
2021-02-14 12:27:26 +00:00
|
|
|
|
2019-03-01 15:37:43 +00:00
|
|
|
VOLUME /home/user/.cargo/tmp
|
|
|
|
VOLUME /home/user/.cargo/git
|
2021-02-14 12:27:26 +00:00
|
|
|
VOLUME /home/user/.cargo/registry
|