Skip to content

Commit

Permalink
improve docker build caching (paritytech#1045)
Browse files Browse the repository at this point in the history
* docker: add Dockerfile and .dockerignore to .dockerignore

* docker: install cargo deps before copying code
  • Loading branch information
azban authored and gavofyork committed Nov 1, 2018
1 parent 5552eaf commit 0a10971
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
doc
target
Dockerfile
.dockerignore
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ LABEL description="This is the build stage for Substrate. Here we create the bin
ARG PROFILE=release
WORKDIR /substrate

COPY . /substrate

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y cmake pkg-config libssl-dev git

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH=$PATH:$HOME/.cargo/bin && \
cargo build --$PROFILE
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

COPY . /substrate

RUN export PATH=$PATH:$HOME/.cargo/bin && cargo build --$PROFILE

# ===== SECOND STAGE ======

Expand Down

0 comments on commit 0a10971

Please sign in to comment.