26 lines
645 B
Docker
26 lines
645 B
Docker
|
FROM codercom/enterprise-base:ubuntu
|
||
|
|
||
|
# Run everything as root
|
||
|
USER root
|
||
|
|
||
|
# Set environment variables
|
||
|
ENV RUSTUP_HOME=/opt/rustup
|
||
|
ENV CARGO_HOME=/opt/cargo
|
||
|
ENV PATH=/opt/cargo/bin:$PATH
|
||
|
|
||
|
# Install Rust
|
||
|
COPY rustup.sh /tmp/rustup.sh
|
||
|
RUN /tmp/rustup.sh -y \
|
||
|
--no-modify-path \
|
||
|
--profile minimal \
|
||
|
--default-toolchain stable \
|
||
|
--default-host x86_64-unknown-linux-gnu && \
|
||
|
rm -f /tmp/rustup.sh && \
|
||
|
chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME}
|
||
|
|
||
|
# Validate that cargo and rustc are available
|
||
|
RUN cargo --version && rustc --version
|
||
|
|
||
|
# Set back to coder user
|
||
|
USER coder
|