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

Bug: Substrate-contracts-node Dockerfile #5

Closed
CatarinaPedreira opened this issue Sep 19, 2021 · 2 comments
Closed

Bug: Substrate-contracts-node Dockerfile #5

CatarinaPedreira opened this issue Sep 19, 2021 · 2 comments

Comments

@CatarinaPedreira
Copy link

CatarinaPedreira commented Sep 19, 2021

Bug Context:
I have been trying to create a docker image (with parent image https://hub.docker.com/r/paritytech/ci-linux/) for building and running a substrate-contracts-node (https://github.com/paritytech/substrate-contracts-node).

I followed the official installations steps in the image, followed by installing the node via "RUN cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked".
All these commands execute with no errors and the image builds okay.
It is probably relevant to state that, when following the installation steps of rust, I did not add the "RUN rustup update nightly" instruction to the dockerfile, since docker has known problems with this instruction which don't yet have a solution other than just uninstalling and reinstalling rust in the dockerfile (rust-lang/rustup#2232).

Problem:
When I try to run the image with my docker-compose.yml file (which runs the "substrate-contracts-node --dev --tmp
" command), it returns an error stating that "substrate-contracts-node" is not found.

Any idea why this is?

Below is the relevant excerpt of my Dockerfile:
`RUN apt update

RUN echo "*** Get ubuntu and rust packages ***"
RUN apt install -y build-essential pkg-config git clang curl libssl-dev llvm libudev-dev

RUN set -e

RUN echo "*** Instaling Rust environment ***"
RUN curl https://sh.rustup.rs -y -sSf | sh
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
RUN rustup default nightly

RUN echo "*** Initializing WASM build environment"
RUN rustup target add wasm32-unknown-unknown --toolchain nightly

RUN echo "*** Installing Substrate node environment ***"
RUN cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked

RUN echo "*** Start Substrate node template ***"
CMD substrate-contracts-node --dev
`

And docker-compose.yaml:
`# From https://github.com/substrate-developer-hub/substrate-node-template
version: "3.2"

services:
dev:
container_name: contracts-node-template
image: hyperledger/substrate-all-in-one:latest
working_dir: /var/www/node-template
ports:
- "9944:9944"
environment:
- CARGO_HOME=/var/www/node-template/.cargo
volumes:
- .:/var/www/node-template
- type: bind
source: ./.local
target: /root/.local
`

@CatarinaPedreira CatarinaPedreira changed the title Bug: Substrate-contracts-node in Docker Bug: Substrate-contracts-node Dockerfile Sep 19, 2021
@cmichi
Copy link
Contributor

cmichi commented Sep 23, 2021

@CatarinaPedreira I think this issue has been resolved in our public channel, is that right?

@athei had replied this to a similar question there:

It appears that the installation directory isn't in your PATH. Try to run it by its full path or add the install dir to your path. Should be in ~/.cargo/bin/

@CatarinaPedreira
Copy link
Author

@cmichi Yes! I added the full directory and it worked :) This issue can be closed. Thank you

@cmichi cmichi closed this as completed Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants