Skip to content

Commit

Permalink
Make rustup and cargo usable by non-root
Browse files Browse the repository at this point in the history
Closes tokio-rs#2
  • Loading branch information
sfackler committed Aug 4, 2017
1 parent 562f805 commit 7423694
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
11 changes: 6 additions & 5 deletions 1.19.0/jessie/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM buildpack-deps:jessie

ENV RUST_VERSION=1.19.0
ENV RUSTUP_VERSION=1.5.0
ENV RUST_VERSION=1.19.0 \
RUSTUP_VERSION=1.5.0 \
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN set -eux; \
\
Expand All @@ -21,10 +24,8 @@ RUN set -eux; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain "${RUST_VERSION}"; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rm rustup-init; \
export PATH="/root/.cargo/bin:$PATH"; \
rustup --version; \
cargo --version; \
rustc --version;

ENV PATH /root/.cargo/bin:$PATH
11 changes: 6 additions & 5 deletions 1.19.0/stretch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM buildpack-deps:stretch

ENV RUST_VERSION=1.19.0
ENV RUSTUP_VERSION=1.5.0
ENV RUST_VERSION=1.19.0 \
RUSTUP_VERSION=1.5.0 \
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN set -eux; \
\
Expand All @@ -21,10 +24,8 @@ RUN set -eux; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain "${RUST_VERSION}"; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rm rustup-init; \
export PATH="/root/.cargo/bin:$PATH"; \
rustup --version; \
cargo --version; \
rustc --version;

ENV PATH /root/.cargo/bin:$PATH
11 changes: 6 additions & 5 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM buildpack-deps:%%DEBIAN-SUITE%%

ENV RUST_VERSION=%%RUST-VERSION%%
ENV RUSTUP_VERSION=%%RUSTUP-VERSION%%
ENV RUST_VERSION=%%RUST-VERSION%% \
RUSTUP_VERSION=%%RUSTUP-VERSION%% \
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN set -eux; \
\
Expand All @@ -13,10 +16,8 @@ RUN set -eux; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain "${RUST_VERSION}"; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rm rustup-init; \
export PATH="/root/.cargo/bin:$PATH"; \
rustup --version; \
cargo --version; \
rustc --version;

ENV PATH /root/.cargo/bin:$PATH

0 comments on commit 7423694

Please sign in to comment.