<p>That means that container <code>CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI</code> do not have binary cardano-cli inside(basically there are no such file) or cardano-cli is there but it is in location what is not inside <code>path</code> of that container, but I would guess it is a first. So this is nothing to do with <code>/ipc/node.socket</code>.</p>
<p>If that container is in docker hub, please let me know which I will try to troubleshoot further.</p>

CC BY-SA 4.0
2022-11-20T17:35:08.980Z
Hey, thanks for the response! Indeed, the binaries are not installed, because I thought I can access them through the node.socket. 

Its a custom image, so I guess I need to install the cli there inside? I'll check some tutorials on how to install the ci without bloating the image too much :) After that I guess I can point cardano-cli to the node.socket (as I already do via the env-var) and it all will work?
Pete22
CC BY-SA 4.0
2022-11-21T08:56:11.413Z
yes, should work. Seems you made it work! Glad I was able to help. Cheers!
os11k
CC BY-SA 4.0
2022-11-21T12:39:29.217Z
Yep, I got it to work :) I updated my post with my solution. Thanks again!
Pete22
CC BY-SA 4.0
2022-11-20T16:05:02.923Z
2022-11-20T16:05:02.923Z
os11k
<p>I have the following problem:</p>
<p>I am running several containers via docker-compose consisting of a cardano-node-container, cardano-db-sync-container (including a postgres-container) AND another container which wants to access the cardano-cli in order to submit transactions. I can't get the cardano-cli command working in the container I want to submit transactions from: &quot;cardano-cli: command not found”. I am out of ideas and not very familiar with unix-sockets.</p>
<p>This is my <strong>docker-compose-file</strong> (irrelevant information replaced with (...)):</p>
<pre><code>version: &quot;3.4&quot;
services:

  homeassistant:
    image: homeassistant/home-assistant:2022.9
    (...)

  CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI:
    image: (...)
    restart: always
    environment:
      - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
    volumes:
      - &quot;node-ipc:/ipc&quot;
    logging: (...)

  cardano-node:
    image: inputoutput/cardano-node:1.35.4
    restart: always
    environment:
      - NETWORK=mainnet
      - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
    volumes:
      - &quot;/volume1/docker/cardano/ada-node:/data&quot;
      - &quot;node-ipc:/ipc&quot;
    healthcheck (...)
    logging (...)

  cardano-db-sync:
    image: inputoutput/cardano-db-sync:13.0.5-extra-args
    restart: always
    environment:
      - NETWORK=mainnet
      - POSTGRES_HOST=cardano-postgres-db
      - POSTGRES_PORT=5432
      - RESTORE_RECREATE_DB=N
    depends_on:
      cardano-node:
        condition: service_healthy
      cardano-postgres-db:
        condition: service_healthy
    secrets:
      - postgres_password
      - postgres_user
      - postgres_db
    volumes:
      - &quot;/volume1/docker/cardano/db-sync-data:/var/lib/cexplorer&quot;
      - &quot;node-ipc:/node-ipc&quot;
    logging: (...)


  cardano-postgres-db:
    image: postgres:11.5-alpine
    restart: on-failure
    environment:
      - POSTGRES_LOGGING=true
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
    secrets:
      - postgres_password
      - postgres_user
      - postgres_db
    volumes:
      - &quot;/volume1/docker/cardano/db-sync-postgres-db:/var/lib/postgresql/data&quot;
    healthcheck: (...)
    logging: (...)

secrets:
  postgres_db:
    file: ./config/secrets/postgres_db
  postgres_password:
    file: ./config/secrets/postgres_password
  postgres_user:
    file: ./config/secrets/postgres_user

volumes:
  node-ipc:
</code></pre>
<p>When I get into the containers bash that wants to access cardano-cli (CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI) I can see, that there is the node.socket file at the defined /ipc/ folder.</p>
<p>Now I do not know what else to do :-/ I tried playing around with socat but couldn't figure out how to use the node-socket in order to <strong>use the cardano-cli via bash</strong>. The cardano-node is fully synced and cardano-db-sync is also working as expected. I can use cardano-cli inside the cardano-node container, but not from others.</p>
<p>The dirties version I can think of to accomplish this, would be installing ssh inside the cardano-node container and access the cli from the other container via sshing into the node. But this would be my last resort if you do not have any ideas for using the cli via the socket :confused:</p>
<p><strong>Edit:</strong>
Okay found a solution :) The base of my &quot;CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI&quot;-container is node:17-alpine.</p>
<p>I am now pulling the hydra-binaries from <a href="https://github.com/input-output-hk/cardano-node/releases" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-node/releases</a>, unpacking and placing them inside my /usr/local/bin folder.
Now I am able to use the cli from bash :D</p>
<p>This is my edited Dockerfile:</p>
<pre><code>FROM node:17-alpine as node


RUN apk add curl
RUN apk add tar

# dl cardano cli-binary 1.35.4
WORKDIR /dl-bin
RUN curl https://hydra.iohk.io/build/21343721/download/1/cardano-node-1.35.4-linux.tar.gz -o cardano-node.tar.gz
RUN tar -xzf cardano-node.tar.gz &amp;&amp; rm cardano-node.tar.gz
RUN cp -r /dl-bin/. /usr/local/bin
WORKDIR /
RUN rm -rf /dl-bin
# end dl cardano cli-binary 1.35.4

(...)
</code></pre>

<cardano-cli><docker>
Docker - Cant access cardano-cli from other container than cardano-node
# Docker - Cant access cardano-cli from other container than cardano-node

(Asked by: username_0 on 2022-11-20)

I have the following problem:
I am running several containers via docker-compose consisting of a cardano-node-container, cardano-db-sync-container (including a postgres-container) AND another container which wants to access the cardano-cli in order to submit transactions. I can't get the cardano-cli command working in the container I want to submit transactions from: "cardano-cli: command not found”. I am out of ideas and not very familiar with unix-sockets.
This is my docker-compose-file (irrelevant information replaced with (...)):
version: "3.4"
services:

  homeassistant:
    image: homeassistant/home-assistant:2022.9
    (...)

  CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI:
    image: (...)
    restart: always
    environment:
      - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
    volumes:
      - "node-ipc:/ipc"
    logging: (...)

  cardano-node:
    image: inputoutput/cardano-node:1.35.4
    restart: always
    environment:
      - NETWORK=mainnet
      - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
    volumes:
      - "/volume1/docker/cardano/ada-node:/data"
      - "node-ipc:/ipc"
    healthcheck (...)
    logging (...)

  cardano-db-sync:
    image: inputoutput/cardano-db-sync:13.0.5-extra-args
    restart: always
    environment:
      - NETWORK=mainnet
      - POSTGRES_HOST=cardano-postgres-db
      - POSTGRES_PORT=5432
      - RESTORE_RECREATE_DB=N
    depends_on:
      cardano-node:
        condition: service_healthy
      cardano-postgres-db:
        condition: service_healthy
    secrets:
      - postgres_password
      - postgres_user
      - postgres_db
    volumes:
      - "/volume1/docker/cardano/db-sync-data:/var/lib/cexplorer"
      - "node-ipc:/node-ipc"
    logging: (...)


  cardano-postgres-db:
    image: postgres:11.5-alpine
    restart: on-failure
    environment:
      - POSTGRES_LOGGING=true
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
    secrets:
      - postgres_password
      - postgres_user
      - postgres_db
    volumes:
      - "/volume1/docker/cardano/db-sync-postgres-db:/var/lib/postgresql/data"
    healthcheck: (...)
    logging: (...)

secrets:
  postgres_db:
    file: ./config/secrets/postgres_db
  postgres_password:
    file: ./config/secrets/postgres_password
  postgres_user:
    file: ./config/secrets/postgres_user

volumes:
  node-ipc:

When I get into the containers bash that wants to access cardano-cli (CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI) I can see, that there is the node.socket file at the defined /ipc/ folder.
Now I do not know what else to do :-/ I tried playing around with socat but couldn't figure out how to use the node-socket in order to use the cardano-cli via bash. The cardano-node is fully synced and cardano-db-sync is also working as expected. I can use cardano-cli inside the cardano-node container, but not from others.
The dirties version I can think of to accomplish this, would be installing ssh inside the cardano-node container and access the cli from the other container via sshing into the node. But this would be my last resort if you do not have any ideas for using the cli via the socket :confused:
Edit:
Okay found a solution :) The base of my "CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI"-container is node:17-alpine.
I am now pulling the hydra-binaries from https://github.com/input-output-hk/cardano-node/releases, unpacking and placing them inside my /usr/local/bin folder.
Now I am able to use the cli from bash :D
This is my edited Dockerfile:
FROM node:17-alpine as node


RUN apk add curl
RUN apk add tar

# dl cardano cli-binary 1.35.4
WORKDIR /dl-bin
RUN curl https://hydra.iohk.io/build/21343721/download/1/cardano-node-1.35.4-linux.tar.gz -o cardano-node.tar.gz
RUN tar -xzf cardano-node.tar.gz && rm cardano-node.tar.gz
RUN cp -r /dl-bin/. /usr/local/bin
WORKDIR /
RUN rm -rf /dl-bin
# end dl cardano cli-binary 1.35.4

(...)

**Tags:** cardano-cli, docker

---

## 1 answers

### Answer by username_1 on 2022-11-20. Score: 1 | Accepted answer

That means that container `CONTAINER-TRYING-TO-ACCESS-CARDANO-CLI` do not have binary cardano-cli inside(basically there are no such file) or cardano-cli is there but it is in location what is not inside `path` of that container, but I would guess it is a first. So this is nothing to do with `/ipc/node.socket`.

If that container is in docker hub, please let me know which I will try to troubleshoot further.

> **Comments:**
> **username_0**: Hey, thanks for the response! Indeed, the binaries are not installed, because I thought I can access them through the node.socket.   Its a custom image, so I guess I need to install the cli there inside? I'll check some tutorials on how to install the ci without bloating the image too much :) After that I guess I can point cardano-cli to the node.socket (as I already do via the env-var) and it all will work?  
> **username_1**: yes, should work. Seems you made it work! Glad I was able to help. Cheers!  
> **username_0**: Yep, I got it to work :) I updated my post with my solution. Thanks again!  

---

