Skip to content

Commit

Permalink
Merge pull request #186 from subspace/fix-docker-build
Browse files Browse the repository at this point in the history
Fix building container images
  • Loading branch information
nazar-pc authored Dec 10, 2021
2 parents 19051a0 + cd540e0 commit 3f4aa97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
!/.git/config
!/.git/HEAD
!/crates
!/cumulus
!/polkadot
!/substrate
!/Cargo.lock
!/Cargo.toml
10 changes: 8 additions & 2 deletions Dockerfile-farmer
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile-node
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 3f4aa97

Please sign in to comment.