Skip to content

Instantly share code, notes, and snippets.

@brson
Created May 12, 2016 19:41
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brson/3762a4d581ef867d505f1e83d2d23bc1 to your computer and use it in GitHub Desktop.
Save brson/3762a4d581ef867d505f1e83d2d23bc1 to your computer and use it in GitHub Desktop.
Dockerfile for rustup demo
FROM ubuntu:16.04
RUN apt update
RUN apt install build-essential curl -y
RUN apt install file -y
RUN apt install asciinema -y
RUN apt install unzip -y
RUN apt install emacs24-nox -y
RUN apt install vim -y
RUN apt install nano -y
RUN apt install git -y
RUN apt install libssl-dev -y
RUN apt install zlib1g-dev -y
RUN useradd -ms /bin/bash rust
USER rust
ENV HOME /home/rust
ENV USER rust
ENV SHELL /bin/bash
WORKDIR /home/rust
RUN curl -sSf sh.rustup.rs | sh -s -- -y
RUN echo "export PATH=~/.cargo/bin:$PATH" >> ~/.bashrc
RUN echo "export PS1='\u:\w$ '" >> ~/.bashrc
@chevdor
Copy link

chevdor commented Jul 1, 2020

In general, using many RUN is not such a great idea as it creates many layers.
Once you validate that you stuff work, you should go from:

RUN cmdA
RUN cmdB

to

RUN cmdA && \
    cmdB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment