r0gue-io/pop-cli

fix: error message of `pop build spec` if there is a running `srtool` container

Open

#509 ouverte le 3 avr. 2025

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Rust (39 forks)github user discovery
DevExgood first issuehelp wantedmedium

Métriques du dépôt

Stars
 (113 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

If we run the command manually to build the runtime deterministically with srtool, the docker command throws:

➜ docker run --name srtool --rm -e PACKAGE=parachain-template-runtime -e RUNTIME_DIR=./runtime -e DEFAULT_FEATURES= -e PROFILE=release -e IMAGE=c4e745adbc7d6dd0b3939a15be3a3b27d1ee6c724c2449638553b8b9fa909d75 -v /Users/chungquantin/Developer/pop-network/base-parachain:/build -v /var/folders/tb/r5r120jx4c34f2wnhrv6hx000000gn/T/cargo:/cargo-home docker.io/paritytech/srtool:1.84.1 build --app --json
docker: Error response from daemon: Conflict. The container name "/srtool" is already in use by container "14eef32e8b962cb8ea7d462288ac4f3923893ad4a5b042cecbdb3afcbc2dc4a4". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

However, pop build spec just simply throw an exit code:

◇  Would you like to build the runtime deterministically? This requires a containerization solution (Docker/Podman) and is recommended for production builds.
│  Yes
│
◇  Enter the directory path where the runtime is located:
│  ./runtime
│
┌   Pop CLI : Building your chain spec
│
◒  Building deterministic runtime...                                                                                                                                                                                  ▲  WARNING: You are using docker. It is recommend to use podman instead.
│
-└  Failed to build the deterministic runtime: IO error: command ["sh", "-c", "docker run --name srtool --rm -e PACKAGE=parachain-template-runtime -e RUNTIME_DIR=./runtime -e DEFAULT_FEATURES= -e PROFILE=release -e IMAGE=c4e745adbc7d6dd0b3939a15be3a3b27d1ee6c724c2449638553b8b9fa909d75 -v /Users/chungquantin/Developer/pop-network/base-parachain:/build -v /var/folders/tb/r5r120jx4c34f2wnhrv6hx000000gn/T/cargo:/cargo-home docker.io/paritytech/srtool:1.84.1 build --app --json"] exited with code 125
+ - Docker error: Error response from daemon: Conflict. The container name "/srtool" is already in use by container "14eef32e8b962cb8ea7d462288ac4f3923893ad4a5b042cecbdb3afcbc2dc4a4". You have to remove (or rename) that container to be able to reuse that name.

Guide contributeur