2019-12-05 17:28:49 +00:00
|
|
|
FROM centos:7
|
2019-03-02 00:12:42 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
ARG TOOLCHAIN=stable
|
|
|
|
|
2019-03-02 00:12:42 +00:00
|
|
|
RUN yum groupinstall -y 'Development Tools'
|
2020-11-07 11:59:44 +00:00
|
|
|
RUN yum install -y ruby && gem install asciidoctor -v 2.0.10
|
2020-01-25 12:54:44 +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-02 00:12:42 +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-02 00:12:42 +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
|
2019-03-02 00:12:42 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN env CARGO_HOME=/opt/rust/cargo cargo install cargo-rpm \
|
|
|
|
&& rm -rf /opt/rust/cargo/{git,tmp,registry}
|
2019-03-02 00:12:42 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN yum install -y libstdc++-*.i686 \
|
|
|
|
&& yum install -y glibc-*.i686 \
|
|
|
|
&& yum install -y libgcc.i686
|
2019-03-02 00:12:42 +00:00
|
|
|
|
2021-02-22 15:19:19 +00:00
|
|
|
RUN useradd -ms /bin/bash user
|
|
|
|
USER user
|
|
|
|
WORKDIR /home/user
|
|
|
|
|
|
|
|
RUN mkdir -p /home/user/.cargo \
|
|
|
|
&& ln -s /opt/rust/cargo/config /home/user/.cargo/config
|
2019-03-02 00:12:42 +00:00
|
|
|
|
|
|
|
VOLUME /home/user/.cargo/tmp
|
|
|
|
VOLUME /home/user/.cargo/git
|
2021-02-22 15:19:19 +00:00
|
|
|
VOLUME /home/user/.cargo/registry
|