Skip to content

Commit

Permalink
Allow non-root users access to cargo and rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
bencord0 committed Jun 12, 2021
1 parent 7d8d674 commit fb96930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN curl "https://static.rust-lang.org/rustup/archive/${RUSTUP_VER}/${RUST_ARCH}
~/.cargo/bin/rustup target add x86_64-unknown-linux-musl && \
echo "[build]\ntarget = \"x86_64-unknown-linux-musl\"" > ~/.cargo/config

# Allow non-root access to cargo
RUN chmod a+X /root
COPY etc/profile.d/cargo.sh /etc/profile.d/cargo.sh

# Convenience list of versions and variables for compilation later on
# This helps continuing manually if anything breaks.
ENV SSL_VER="1.0.2u" \
Expand Down
3 changes: 3 additions & 0 deletions etc/profile.d/cargo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if command -v cargo 2>/dev/null; then
export PATH=/root/.cargo/bin:$PATH
fi

0 comments on commit fb96930

Please sign in to comment.