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 authored and Gav Wood committed 2018-11-01 09:47:08 +01:00
1 parent 05a73de366
commit 5a50f15926
2 files changed
+7 -5

No files matched your search

+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 ======