2

Now I am building a new docker image for my substrate node

Docker version 24.0.5, build ced0996

Node version v18.16.1

I am using this Dockerfile.dev to build the docker image.

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" ]

By the way, I got this error and couldn't figure it out.

254.9 info: installing component 'rustfmt'
261.8     Updating git repository `https://github.com/paritytech/substrate.git`
648.1 error: failed to get `frame-benchmarking` as a dependency of package `node-template v4.0.0-dev (/code/node)`
648.1
648.1 Caused by:
648.1   failed to load source for dependency `frame-benchmarking`
648.1
648.1 Caused by:
648.1   Unable to update https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#98f2e345
648.1
648.1 Caused by:
648.1   object not found - no match for id (98f2e3451c9143278ec53c6718940aeabcd3b68a); class=Odb (9); code=NotFound (-3)
------
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: 101

Any kind of answers would be appreciated.

Thanks in advance.

1 Answer 1

2

Seems like this commit (#98f2e345) might no longer exist or you have a corrupt git registry.

After cloning the repo and checking, the commit does exist in the repository.

You can try deleting the cargo.lock or clearing the registry.

5
  • Thank you, @forgetso. It was a good solution to solve the problem.
    – Alan Ma
    Aug 28, 2023 at 16:51
  • Did you try clearing the registry @Ganesh11?
    – forgetso
    Aug 29, 2023 at 9:51
  • yes using this command rm -rf ~/.cargo/registry
    – Ganesh11
    Aug 29, 2023 at 10:05
  • @ganesh11's issue is not same as i posted
    – Alan Ma
    Aug 29, 2023 at 10:06
  • I make sure there is a technical critical error in @ganesh11's substrate node project.
    – Alan Ma
    Aug 29, 2023 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.