Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,23 @@ RUN
# Append to /etc/profile for login shells
RUN echo 'export PATH="/usr/local/go/bin:$PATH"' >> /etc/profile

# Create .cargo directory
RUN mkdir -p /root/.cargo
# Create rust related directories in /usr/local
RUN mkdir -p /usr/local/cargo
RUN mkdir -p /usr/local/rustup
Comment on lines +47 to +48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS, every RUN command creates another layer, maybe reduce it by

Suggested change
RUN mkdir -p /usr/local/cargo
RUN mkdir -p /usr/local/rustup
RUN mkdir -p /usr/local/cargo /usr/local/rustup


# Set environment variable before rustup installation
ENV CARGO_HOME=/usr/local/cargo
ENV RUSTUP_HOME=/usr/local/rustup

# Install rustup and cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.77

# Add cargo to PATH
RUN echo 'export PATH="/root/.cargo/bin:$PATH"' >> /etc/profile
# Add rust related environment variables
RUN echo 'export PATH="/usr/local/cargo/bin:$PATH"' >> /etc/profile
RUN echo 'export CARGO_HOME="/usr/local/cargo"' >> /etc/profile
RUN echo 'export RUSTUP_HOME="/usr/local/rustup"' >> /etc/profile

# Set mode bits for rustup
RUN chmod -R a+w /usr/local/rustup

ENTRYPOINT ["/bin/bash", "-l", "-c"]