Building cardano node, with official docker image

Hi guys!. I’m trying to run a realy node, using cardano docker image from this source. This is the official image, as I read. When I run it, I want to attatch prometheus, to inspect the activity of the node. From the documentation, I read, that prometheus needs two jobs in a minimal configuration. When I attatch the first job to the container, it works fine, but the second, which needs prometheus node exporter, doesn’t work. I assume that the process needs to be up inside the container. In order to that, I need to install prometheus-node-exporter. And that’s my issue. What is the package manager in the cardano official docker image? I tried apt, apk, but I fail. I tried to use nix, but I need to install it with curl, and curl needs tar, to unpack the downloaded package. How do I manage this? Thanks for all of you.

1 Like

Hi!

I think you can start the node exporter outside of the cardano container - since it is enough to measure the the CPU and RAM usage of the system.

1 Like

Ok. Thanks for the advice. But that doesn’t was that I understand from tutorials. Specially from those that talks about using docker. Even, you can see the Dockerfile from viper stake pool. They expose the node from the container.


This is the image from source

so - docker containers are usually represent a micro service - so you dont have to merge node exporter service with cardano-node service within a container - instead split the two services into two container. since these services are independent from each other. Means you dont need to heck an official image…
The tutorial just suggest that you can monitor system related metrics… and if a Dockerfile contains something, that does not mean that, that is the way you need to follow… instead I am suggesting to follow the concept of containerized micro services…

1 Like

Thanks for that. So, the better practice is to execute prometheus_node_exporter from other service/container.

yes - build an image from a Dockerfile which contains only the node_exporter - then run that image and expose the ports of the node_exporter… and with docker-compose you can start/stop these containers with all the necessary params

1 Like

btw - there is an instructions how to start this service:

there you can see the docker-compose file - which can be extended with cardano-node service…

1 Like