Description
External
Running cardano-node in a docker container and connecting via ipc
I am trying to run cardano-node in docker container A and want to use cardano-cli in docker container B. The Docker Hub page shows a simple example in which /ipc is volume-mounted in both containers. But when I execute cardano-cli in the second container, the node stops and the cli prints this error:
bash-4.4# cardano-cli query utxo --address $address --mainnet
Command failed: query utxo Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH Error: "CARDANO_NODE_SOCKET_PATH"
Steps to reproduce
-
start cardano-node, e.g.
docker run -e NETWORK=mainnet -v /Users/xxx/dev/cardano-node-mint/node-ipc:/ipc inputoutput/cardano-node
-> starts up and syncs, seems to run fine -
start second container just for cli usage
docker -it -e NETWORK=mainnet -v /Users/I511648/dev/cardano-node-mint/node-ipc:/ipc --entrypoint /bin/bash inputoutput/cardano-node
Then ty running a command like
cardano-cli query utxo --address xxx--mainnet
Command failed: query utxo Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH Error: "CARDANO_NODE_SOCKET_PATH"
Moments before the cardano-node in the first container will also stop. I tried to set CARDANO_NODE_SOCKET_PATH explicitly to /ipc/node.socket but it does not change the issue.
Expected behavior
cardano-node keeps working and cardano-cli prints the address info
System info (please complete the following information):
Docker on Mac Os X
cardano-node 1.34.1 - linux-x86_64 - ghc-8.10
git rev 73f9a74
cardano-cli 1.34.1 - linux-x86_64 - ghc-8.10
git rev 73f9a74