Skip to content

Commit 3f4aa97

Browse files
authored
Merge pull request #186 from subspace/fix-docker-build
Fix building container images
2 parents 19051a0 + cd540e0 commit 3f4aa97

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
!/.git/config
55
!/.git/HEAD
66
!/crates
7+
!/cumulus
8+
!/polkadot
79
!/substrate
810
!/Cargo.lock
911
!/Cargo.toml

Dockerfile-farmer

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown
1717
COPY Cargo.lock /code/Cargo.lock
1818
COPY Cargo.toml /code/Cargo.toml
1919

20-
# Up until this line all Rust images in this repo should be the same to share the same layers
21-
20+
# Just enough files for `git rev-parse --short HEAD` to work (used in Substrate node build)
21+
COPY .git /code/.git
22+
# Just an empty directory for Git to recognize it is indeed a Git repository
23+
RUN mkdir /code/.git/objects
2224
COPY crates /code/crates
25+
COPY cumulus /code/cumulus
26+
COPY polkadot /code/polkadot
2327
COPY substrate /code/substrate
2428

29+
# Up until this line all Rust images in this repo should be the same to share the same layers
30+
2531
RUN \
2632
/root/.cargo/bin/cargo build --release --bin subspace-farmer && \
2733
mv target/release/subspace-farmer subspace-farmer && \

Dockerfile-node

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown
1717
COPY Cargo.lock /code/Cargo.lock
1818
COPY Cargo.toml /code/Cargo.toml
1919

20-
# Up until this line all Rust images in this repo should be the same to share the same layers
21-
2220
# Just enough files for `git rev-parse --short HEAD` to work (used in Substrate node build)
2321
COPY .git /code/.git
2422
# Just an empty directory for Git to recognize it is indeed a Git repository
2523
RUN mkdir /code/.git/objects
2624
COPY crates /code/crates
25+
COPY cumulus /code/cumulus
26+
COPY polkadot /code/polkadot
2727
COPY substrate /code/substrate
2828

29+
# Up until this line all Rust images in this repo should be the same to share the same layers
30+
2931
RUN \
3032
/root/.cargo/bin/cargo build --release --bin subspace-node && \
3133
mv target/release/subspace-node subspace-node && \

0 commit comments

Comments
 (0)