<p>A solution, involving setting up a new docker image, can be found here: <a href="https://cardano.stackexchange.com/a/8940/7460">https://cardano.stackexchange.com/a/8940/7460</a></p>

CC BY-SA 4.0
2022-08-24T19:07:28.133Z
2022-08-24T19:07:28.133Z
Christian Schmitz
<p>Here's how I solved it:</p>
<p>Get the config files from here: <a href="https://book.world.dev.cardano.org/environments/preprod/" rel="nofollow noreferrer">https://book.world.dev.cardano.org/environments/preprod/</a></p>
<p>Place the config files in <code>$PWD/config/docker_configs/preprod</code> where <code>$PWD</code> is the dir containing your compose.</p>
<p><strong>docker-compose.yml</strong></p>
<pre><code>  cardano-node-testnet:
    image: inputoutput/cardano-node:1.35.3
    container_name: cardano_node_testnet
    volumes:
      - node-testnet-db:/data/db
      - node-ipc:/ipc
      - $PWD/config/docker_configs/preprod:/config
    command:
      - run
      - --config /config/config.json
      - --topology /config/topology.json
      - --database-path /data/db
      - --socket-path /ipc/node.socket
    restart: on-failure
    healthcheck:
      # Ping the EKG port to see if it responds.
      # Assuming if EKG isn't up then the rest of cardano-node isn't either.
      test: [ &quot;CMD-SHELL&quot;, &quot;curl -f 127.0.0.1:12788 || exit 1&quot; ]
      interval: 60s
      timeout: 10s
      retries: 5
    logging:
      driver: &quot;json-file&quot;
      options:
        compress: &quot;true&quot;
        max-file: &quot;10&quot;
        max-size: &quot;50m&quot;
</code></pre>
<p>Thanks to adamuso on the iohk discord for the help.</p>

CC BY-SA 4.0
2022-08-25T16:57:48.740Z
2022-08-25T16:57:48.740Z
melchoir55
<p>Please check my post in cardano forum here:</p>
<p><a href="https://forum.cardano.org/t/relay-node-in-docker/102416/2?u=os11k" rel="nofollow noreferrer">https://forum.cardano.org/t/relay-node-in-docker/102416/2?u=os11k</a></p>
<p>Basically you need to run it in docker compose, config files should be under <code>./node-config</code> on host server. Keep in mind in my example I use <code>testnet-config.json</code> &amp; <code>testnet-topology.json</code> as file names, you can change them in Dockerfile.</p>
<p>And you need to have Dockerfile in same dir where is docker-compose.yml</p>
<pre><code>FROM inputoutput/cardano-node:1.35.3
ENV CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
ENTRYPOINT [&quot;/usr/local/bin/cardano-node&quot;, &quot;run&quot;, &quot;+RTS&quot;, &quot;-N&quot;, &quot;-A16m&quot;, &quot;-qg&quot;, &quot;-qb&quot;, &quot;-RTS&quot;, &quot;--topology&quot;, &quot;/config/testnet-topology.json&quot;, &quot;--database-path&quot;, &quot;/data/db&quot;, &quot;--socket-path&quot;, &quot;/ipc/node.socket&quot;, &quot;--host-addr&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;6001&quot;, &quot;--config&quot;, &quot;/config/testnet-config.json&quot; ]
</code></pre>
<p>That should make it.</p>

CC BY-SA 4.0
2022-08-25T15:45:50.400Z
2022-08-25T15:45:50.400Z
os11k
<p>The dockerized version of <code>cardano-node</code> version <code>1.35.3</code> connects to the mainnet by default. We wish to connect the node to the new pre-production or preview testnets. It isn't made clear in any documentation how to accomplish this.</p>
<p>For reference, I'm referring to this image: <a href="https://hub.docker.com/r/inputoutput/cardano-node" rel="nofollow noreferrer">https://hub.docker.com/r/inputoutput/cardano-node</a></p>
<p>This is related to <a href="https://cardano.stackexchange.com/questions/8937/what-are-the-valid-network-values-for-docker-node-images">What are the valid NETWORK values for docker node images?</a></p>

<cardano-node><docker>
Connect docker cardano-node 1.35.3 to pre-production testnet
# Connect docker cardano-node 1.35.3 to pre-production testnet

(Asked by: username_0 on 2022-08-24)

The dockerized version of `cardano-node` version `1.35.3` connects to the mainnet by default. We wish to connect the node to the new pre-production or preview testnets. It isn't made clear in any documentation how to accomplish this.

For reference, I'm referring to this image: <https://hub.docker.com/r/inputoutput/cardano-node>

This is related to [What are the valid NETWORK values for docker node images?](https://cardano.stackexchange.com/questions/8937/what-are-the-valid-network-values-for-docker-node-images)

**Tags:** cardano-node, docker

---

## 3 answers

### Answer by username_1 on 2022-08-24. Score: 1

A solution, involving setting up a new docker image, can be found here: <https://cardano.stackexchange.com/a/8940/7460>


---

### Answer by username_0 on 2022-08-25. Score: 1

Here's how I solved it:
Get the config files from here: https://book.world.dev.cardano.org/environments/preprod/
Place the config files in $PWD/config/docker_configs/preprod where $PWD is the dir containing your compose.
docker-compose.yml
  cardano-node-testnet:
    image: inputoutput/cardano-node:1.35.3
    container_name: cardano_node_testnet
    volumes:
      - node-testnet-db:/data/db
      - node-ipc:/ipc
      - $PWD/config/docker_configs/preprod:/config
    command:
      - run
      - --config /config/config.json
      - --topology /config/topology.json
      - --database-path /data/db
      - --socket-path /ipc/node.socket
    restart: on-failure
    healthcheck:
      # Ping the EKG port to see if it responds.
      # Assuming if EKG isn't up then the rest of cardano-node isn't either.
      test: [ "CMD-SHELL", "curl -f 127.0.0.1:12788 || exit 1" ]
      interval: 60s
      timeout: 10s
      retries: 5
    logging:
      driver: "json-file"
      options:
        compress: "true"
        max-file: "10"
        max-size: "50m"

Thanks to adamuso on the iohk discord for the help.


---

### Answer by username_2 on 2022-08-25. Score: 0

Please check my post in cardano forum here:
https://forum.cardano.org/t/relay-node-in-docker/102416/2?u=os11k
Basically you need to run it in docker compose, config files should be under ./node-config on host server. Keep in mind in my example I use testnet-config.json & testnet-topology.json as file names, you can change them in Dockerfile.
And you need to have Dockerfile in same dir where is docker-compose.yml
FROM inputoutput/cardano-node:1.35.3
ENV CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
ENTRYPOINT ["/usr/local/bin/cardano-node", "run", "+RTS", "-N", "-A16m", "-qg", "-qb", "-RTS", "--topology", "/config/testnet-topology.json", "--database-path", "/data/db", "--socket-path", "/ipc/node.socket", "--host-addr", "0.0.0.0", "--port", "6001", "--config", "/config/testnet-config.json" ]

That should make it.


---

