Running the relay node with docker IOHK

I’ve downloaded the docker cardano-node image, but I’m confused how to run the docker using the pre-loaded configuration and the NETWORK env, based on this official site: Docker Hub

From the example:

docker run -v /data -e NETWORK=mainnet inputoutput/cardano-node

It returns a error message sicne I didn’t do the pre-configuration:

cardano-node: Network.Socket.bind: does not exist (No such file or directory)

Normally, I map the volume folder to my local folder, why in this case we pass only /data? How do we perform the pre-configuration?
Thanks!

1 Like

Hi!

Try to add another volume which stores the socket file
docker run --rm -v /ipc -v /data -e NETWORK=mainnet inputoutput/cardano-node

when running the the docker the cardano-node process started with the flag --socket-path /ipc/node.socket - this flag tells where the socket file is located - so by now I dont know why it does not create it if the folder is not mounted volume - but at least you have a workaround…

1 Like

There are a number of issues with that image. The docs for an improved incubator image are here.

Just went through the list of the issues - but those mainly kubernetes or convenient issues…
Docker image main purpose is to get the cardano-node binary… from official sources.
Then it is up to you how to integrate that image into your environment.
btw just registered this issue on github:

1 Like

It also takes care of …

  • graceful shutdown
  • topologogy updates
  • inlined topology config
  • config through env vars
  • support for arm64

Thanks @laplasz! It works with the -v /ipc. If I use -v ipc:/ipc, I can see that in the ipc folder the node.socket is created.

Furthermore, using the command docker run --rm -v /ipc -v /data -e NETWORK=mainnet inputoutput/cardano-node, it sets the host ip to the localhost. From the another example command on the docker page, it suggests to use --config /configuration/configuration.yaml --topology /configuration/topology.json. However, both files are in the docker file. How can I see and edit the files outside the docker image?

If IOHK can create a good comprehensive documentation about the cardano in general and the cardano-node, why didn’t they write more information for this docker image. I found a lot of other docker images with better information.

1 Like

so to use the host network - there is another flag: --network host but you need to only expose the cardano listening port with flag: –expose=3001
to able to provide your own configs you need to mount the config folder then providing the mounted configs to cardano-node - that what the following command doing:

docker run -v /home/user/configuration/defaults:/configuration \
     inputoutput/cardano-node run \
      --config /configuration/configuration.yaml \
      --topology /configuration/topology.json \
      --database-path /db

more information about docker run and volumes here: