improve docker build caching (#1045)

* docker: add Dockerfile and .dockerignore to .dockerignore

* docker: install cargo deps before copying code
This commit is contained in:
azban
2018-11-01 01:47:08 -07:00
committed by Gav Wood
parent 05a73de366
commit 5a50f15926
2 changed files with 7 additions and 5 deletions
+2
View File
@@ -1,2 +1,4 @@
doc
target
Dockerfile
.dockerignore
+5 -5
View File
@@ -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 ======