<p>Approach 1 is the only one that makes sense to me in my limited knowledge of Containers. Containers, I understand, are different operating system context, not just different process so there isn't really IPC outside of the Docker api. The TCP/IP stack really shines here. Have a small web service with your Cardano-node / Cardano-cli which does basic things with the software and have an additional webserver act as the application level service, in my opinion.</p>

CC BY-SA 4.0
2021-09-27T20:16:05.090Z
Yeah, that's something that I've thought about. However, the way the official Docker image was built makes it hard to extend. I have been thinking of creating my own following the Linux setup steps from the docs.

The other part of your answer is that the docker-node image exposes the IPC through a volume, so that makes me think that it is possible to achieve such inter container communication; I don't know-how.

This is my docker-compose.yml
Nacho Vazquez Calleja
CC BY-SA 4.0
2021-09-27T20:16:53.587Z
```yml
version: '3.1'

services:
  cardano-node:
    image: inputoutput/cardano-node
    environment:
      - NETWORK=testnet
      - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
    volumes:
      - data:/data
      - node-ipc:/ipc
      - ./dist/apps/cardano-server/outputs:/outputs

volumes:
  data:
  node-ipc:
```
Nacho Vazquez Calleja
CC BY-SA 4.0
2021-09-27T18:46:02.617Z
2021-09-27T18:46:02.617Z
Patrick Sturm
<p>NIX is used to build the image. There is no Dockerfile (as far as I know).
<a href="https://github.com/input-output-hk/cardano-node/blob/master/nix/docker/default.nix" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-node/blob/master/nix/docker/default.nix</a></p>
<hr />
<p>You can establish cross-container communication via node.socket:</p>
<pre><code>docker run -e NETWORK=mainnet -v node-ipc:/ipc inputoutput/cardano-node
docker run -e NETWORK=mainnet -v node-ipc:/ipc inputoutput/some-node-client
</code></pre>
<p><a href="https://hub.docker.com/r/inputoutput/cardano-node" rel="nofollow noreferrer">https://hub.docker.com/r/inputoutput/cardano-node</a></p>

CC BY-SA 4.0
2021-10-02T04:13:25.350Z
Thanks, I might try that later. For now, I'm building upon a community image for the Cardano Node.
Nacho Vazquez Calleja
CC BY-SA 4.0
2021-10-01T05:42:34.807Z
2021-10-01T05:42:34.807Z
eddex
<p>Can anyone help me with something, I'm trying to run a web server over the cardano-node docker image.</p>
<p>I have some solutions in mind but I would like to have some feedback from you.</p>
<p>Approach # 1</p>
<p>Build a new image over the cardano-node docker image that install node and runs my server code.</p>
<p>My questions around this are:</p>
<ul>
<li>Where can I find the cardano-node Dockerfile? I need to know what is already setup and what is the underlaying Linux distro.</li>
<li>Related to the previous one, how can I install Node over the cardano-node image? I have tried multiple mechanisms like apt-get and nothing works.</li>
</ul>
<p>Approach # 2</p>
<p>Create my webserver in a different docker image and make the container communicate with the cardano-node container.</p>
<p>Questions:</p>
<ul>
<li>How can I communicate my web server container with the cardano-node container so I can run the cardano-cli commands?</li>
</ul>

<cardano-cli><cardano-node><docker>
Executing cardano-cli inside a docker container from another docker container
# Executing cardano-cli inside a docker container from another docker container

(Asked by: username_0 on 2021-09-27)

Can anyone help me with something, I'm trying to run a web server over the cardano-node docker image.

I have some solutions in mind but I would like to have some feedback from you.

Approach # 1

Build a new image over the cardano-node docker image that install node and runs my server code.

My questions around this are:

* Where can I find the cardano-node Dockerfile? I need to know what is already setup and what is the underlaying Linux distro.
* Related to the previous one, how can I install Node over the cardano-node image? I have tried multiple mechanisms like apt-get and nothing works.

Approach # 2

Create my webserver in a different docker image and make the container communicate with the cardano-node container.

Questions:

* How can I communicate my web server container with the cardano-node container so I can run the cardano-cli commands?

**Tags:** cardano-cli, cardano-node, docker

---

## 2 answers

### Answer by username_1 on 2021-09-27. Score: 3

Approach 1 is the only one that makes sense to me in my limited knowledge of Containers. Containers, I understand, are different operating system context, not just different process so there isn't really IPC outside of the Docker api. The TCP/IP stack really shines here. Have a small web service with your Cardano-node / Cardano-cli which does basic things with the software and have an additional webserver act as the application level service, in my opinion.

> **Comments:**
> **username_0**: Yeah, that's something that I've thought about. However, the way the official Docker image was built makes it hard to extend. I have been thinking of creating my own following the Linux setup steps from the docs.  The other part of your answer is that the docker-node image exposes the IPC through a volume, so that makes me think that it is possible to achieve such inter container communication; I don't know-how.  This is my docker-compose.yml  
> **username_0**: ```yml version: '3.1'  services:   cardano-node:     image: inputoutput/cardano-node     environment:       - NETWORK=testnet       - CARDANO_NODE_SOCKET_PATH=/ipc/node.socket     volumes:       - data:/data       - node-ipc:/ipc       - ./dist/apps/cardano-server/outputs:/outputs  volumes:   data:   node-ipc: ```  

---

### Answer by username_2 on 2021-10-01. Score: 1

NIX is used to build the image. There is no Dockerfile (as far as I know).
https://github.com/input-output-hk/cardano-node/blob/master/nix/docker/default.nix

You can establish cross-container communication via node.socket:
docker run -e NETWORK=mainnet -v node-ipc:/ipc inputoutput/cardano-node
docker run -e NETWORK=mainnet -v node-ipc:/ipc inputoutput/some-node-client

https://hub.docker.com/r/inputoutput/cardano-node

> **Comments:**
> **username_0**: Thanks, I might try that later. For now, I'm building upon a community image for the Cardano Node.  

---

