Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run the substrate dockerfile #2750

Open
2 tasks done
kamalbuilds opened this issue Dec 19, 2023 · 4 comments · May be fixed by #4450
Open
2 tasks done

Unable to run the substrate dockerfile #2750

kamalbuilds opened this issue Dec 19, 2023 · 4 comments · May be fixed by #4450
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@kamalbuilds
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

=> ERROR [builder 4/4] RUN cargo build --locked --release 2.7s

[builder 4/4] RUN cargo build --locked --release:
2.610 error: could not find Cargo.toml in /substrate or any parent directory


substrate_builder.Dockerfile:6

4 | WORKDIR /substrate
5 | COPY . /substrate
6 | >>> RUN cargo build --locked --release
7 |
8 | # This is the 2nd stage: a very small image where we copy the Substrate binary."

ERROR: failed to solve: process "/bin/sh -c cargo build --locked --release" did not complete successfully: exit code: 101

image

image

Steps to reproduce

cd substrate/docker

./build.sh

@kamalbuilds kamalbuilds added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 19, 2023
@bkchr
Copy link
Member

bkchr commented Dec 19, 2023

Yeah the Dockerfile was probably not updated for the new repo structure. Maybe you could fix it @kamalbuilds and add a pr?

@kamalbuilds
Copy link
Author

@bkchr I dont know how to fix it coz I have been struggliug to make the node run from past 3 days. Fixed the earlier to arrive at this .
image

@gilescope
Copy link
Contributor

Had a look but docker.io/paritytech/ci-linux:production is running rust 1.55. Is there a more up to date image that should be used?

Once I fix up the dirs I get:
"The package requires the Cargo feature called named-profiles, but that feature is not stabilized in this version of Cargo (1.55.0 (32da73ab1 2021-08-23))."

@ltfschoen
Copy link

ltfschoen commented May 13, 2024

i've been going through fixing this too since yesterday since i want to use the Substrate Docker for a hackathon where the audience could be using different operating systems. i'm using a macOS M2 Pro 64Gb and it takes ~52 mins to build.

so far i've fixed the following errors:

  • error: could not find Cargo.toml in /substrate or any parent directory
  • error: failed to select a version for env_logger
  • fetch-pack: unexpected disconnect while reading sideband packet

but i still got the following error because the latest docker.io/paritytech/ci-linux:production hasn't been updated for 10 months and is still using RUST_NIGHTLY=2023-05-23 on this line https://github.com/paritytech/scripts/blob/master/dockerfiles/ci-linux/Dockerfile#L7

  • error: package jsonrpsee-types v0.22.5 cannot be built because it requires rustc 1.74.1 or newer, while the currently active rustc version is 1.70.0

so since i can't modify that docker.io/paritytech/ci-linux:production without first creating a separate PR to https://github.com/paritytech/scripts/blob/master/dockerfiles/ci-linux/Dockerfile, so in the interim i'm modifying the line RUN cargo build --locked --release in ./substrate/docker/substrate_builder.Dockerfile, to instead be something like RUN RUST_NIGHTLY=2024-04-29 ... cargo build --locked --release to check what works.

so just to clarify, if i get it to work, and we want to update docker.io/paritytech/ci-linux:production to use the latest Rust version that is compatible with the polkadot-sdk rather than the old version RUST_NIGHTLY=2023-05-23 that breaks the build, do we just create a PR to modify https://github.com/paritytech/scripts/blob/master/dockerfiles/ci-linux/Dockerfile, and if the PR gets merged then a new release of docker.io/paritytech/ci-linux:production gets created?

note: docker.io/paritytech/ci-linux:production uses code from these repos:

the above errors seem to be the reason why other issues like this #2301 are being created.

FYI, for my own project for xcm testing i created a custom version of docker.io/paritytech/ci-linux:production that uses a more recent Rust version here https://github.com/ltfschoen/XCMTemplate/blob/main/docker/Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants