I try to build a docker image for the https://github.com/substrate-developer-hub/substrate-node-template.
I used this file to do it. Dockerfile.dev
.
FROM paritytech/ci-linux:production as build
WORKDIR /code
COPY . .
RUN cargo build --release
FROM ubuntu:22.04
WORKDIR /node
# Copy the node binary.
COPY --from=build /code/target/release/node-template .
# Install root certs, see: https://github.com/paritytech/substrate/issues/9984
# RUN apt update && \
# apt install -y ca-certificates && \
# update-ca-certificates && \
# apt remove ca-certificates -y && \
# rm -rf /var/lib/apt/lists/*
EXPOSE 9944
CMD [ "./node-template", "--dev" ]
When I run docker build -f Dockerfile.dev -t wolfmorgan/xcavate-substrate-node .
, I got this.
9.664 info: downloading component 'rust-analyzer'
11.02 info: downloading component 'rust-src'
11.43 info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
15.25 info: downloading component 'rust-std'
21.11 info: downloading component 'rustc'
35.06 info: downloading component 'rustc-dev'
54.36 info: downloading component 'rustfmt'
54.95 info: removing previous version of component 'rust-std' for 'wasm32-unknown-unknown'
59.43 info: rolling back changes
59.44 error: could not rename component file from '/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib' to '/usr/local/rustup/tmp/pz7l5tq2toy2zfqw_dir/bk'
59.45
59.45 Caused by:
59.45 Invalid cross-device link (os error 18)
------
Dockerfile.dev:5
--------------------
3 | WORKDIR /code
4 | COPY . .
5 | >>> RUN cargo build --release
6 |
7 | FROM ubuntu:22.04
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 1
Please help me to fix this issue. Thank you in advance.