Skip to main content

Cardano Docker CheatSheet


Cardano Docker CheatSheet

  1. Pulling the Cardano Node Docker Image:

docker pull cardano-node:latest
  1. Running a Cardano Node Container:

docker run -d --name cardano-node -p 3001:3001 cardano-node:latest
	•	-d: Run the container in detached mode (background).
	•	--name: Assign a name to the container.
	•	-p: Map the host port to the container port.
  1. Checking Logs of the Cardano Node Container:

docker logs -f cardano-node
	•	-f: Follow the log output in real-time.
  1. Stopping the Cardano Node Container:

docker stop cardano-node
  1. Removing the Cardano Node Container:

docker rm cardano-node
  1. Running Cardano Node with Persistent Data:

docker run -d --name cardano-node -p 3001:3001 -v /path/on/host:/path/in/container cardano-node:latest
	#	-v: Mount a volume (for data persistence).
  1. Entering the Cardano Node Container:

docker exec -it cardano-node /bin/bash	-it
: Interactive terminal.
  1. Updating the Cardano Node Docker Image:

docker pull cardano-node:latest 
docker stop cardano-node 
docker rm cardano-node 
docker run -d --name cardano-node -p 3001:3001 cardano-node:latest
  1. Building a Custom Cardano Node Docker Image:

docker build -t custom-cardano-node:latest /path/to/Dockerfile/directory
  1. Listing All Running Containers:

docker ps
  1. Listing All Containers (Running + Stopped):

docker ps -a
  1. Removing Unused Docker Images:

docker image prune

Note: This CheatSheet assumes you have a Docker image named cardano-node for the Cardano node. Adjust commands accordingly if you're using a different image name or tag. Always refer to the official Cardano documentation for specific configurations and best practices when running a node.