File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 43
43
# Append to /etc/profile for login shells
44
44
RUN echo 'export PATH="/usr/local/go/bin:$PATH"' >> /etc/profile
45
45
46
- # Create .cargo directory
47
- RUN mkdir -p /root/.cargo
46
+ # Create rust related directories in /usr/local
47
+ RUN mkdir -p /usr/local/cargo
48
+ RUN mkdir -p /usr/local/rustup
49
+
50
+ # Set environment variable before rustup installation
51
+ ENV CARGO_HOME=/usr/local/cargo
52
+ ENV RUSTUP_HOME=/usr/local/rustup
48
53
49
54
# Install rustup and cargo
50
55
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.77
51
56
52
- # Add cargo to PATH
53
- RUN echo 'export PATH="/root/.cargo/bin:$PATH"' >> /etc/profile
57
+ # Add rust related environment variables
58
+ RUN echo 'export PATH="/usr/local/cargo/bin:$PATH"' >> /etc/profile
59
+ RUN echo 'export CARGO_HOME="/usr/local/cargo"' >> /etc/profile
60
+ RUN echo 'export RUSTUP_HOME="/usr/local/rustup"' >> /etc/profile
61
+
62
+ # Set mode bits for rustup
63
+ RUN chmod -R a+w /usr/local/rustup
54
64
55
65
ENTRYPOINT ["/bin/bash" , "-l" , "-c" ]
You can’t perform that action at this time.
0 commit comments