From cd540e0a9374fbd1c76aad8b884a602055946ae8 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Thu, 9 Dec 2021 20:55:31 +0200 Subject: [PATCH] Fix building container images --- .dockerignore | 2 ++ Dockerfile-farmer | 10 ++++++++-- Dockerfile-node | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index c5a1a554c5..f155a8a571 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,8 @@ !/.git/config !/.git/HEAD !/crates +!/cumulus +!/polkadot !/substrate !/Cargo.lock !/Cargo.toml diff --git a/Dockerfile-farmer b/Dockerfile-farmer index e4e297fba7..92ed3778af 100644 --- a/Dockerfile-farmer +++ b/Dockerfile-farmer @@ -17,11 +17,17 @@ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml -# Up until this line all Rust images in this repo should be the same to share the same layers - +# Just enough files for `git rev-parse --short HEAD` to work (used in Substrate node build) +COPY .git /code/.git +# Just an empty directory for Git to recognize it is indeed a Git repository +RUN mkdir /code/.git/objects COPY crates /code/crates +COPY cumulus /code/cumulus +COPY polkadot /code/polkadot COPY substrate /code/substrate +# Up until this line all Rust images in this repo should be the same to share the same layers + RUN \ /root/.cargo/bin/cargo build --release --bin subspace-farmer && \ mv target/release/subspace-farmer subspace-farmer && \ diff --git a/Dockerfile-node b/Dockerfile-node index a4bed4c674..5240126683 100644 --- a/Dockerfile-node +++ b/Dockerfile-node @@ -17,15 +17,17 @@ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml -# Up until this line all Rust images in this repo should be the same to share the same layers - # Just enough files for `git rev-parse --short HEAD` to work (used in Substrate node build) COPY .git /code/.git # Just an empty directory for Git to recognize it is indeed a Git repository RUN mkdir /code/.git/objects COPY crates /code/crates +COPY cumulus /code/cumulus +COPY polkadot /code/polkadot COPY substrate /code/substrate +# Up until this line all Rust images in this repo should be the same to share the same layers + RUN \ /root/.cargo/bin/cargo build --release --bin subspace-node && \ mv target/release/subspace-node subspace-node && \