Installing cadvisor on Fedora Server

In this tutorial, we will guide you through the process of installing cadvisor, an open-source container monitoring tool from GitHub, on Fedora Server. Before we begin, make sure you have administrative privileges to install software on your system.

Step 1: Installing Docker

Cadvisor is a Docker container that requires Docker to be installed on your system. If you don't have Docker already installed, run the following command to install it:

sudo dnf install docker-ce

Once Docker is installed, start and enable the Docker service with the following command:

sudo systemctl start docker
sudo systemctl enable docker

Step 2: Downloading and Running the cadvisor Container

To download and run the cadvisor container, run the following command:

sudo docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8080:8080 --detach=true --name=cadvisor google/cadvisor:latest

Explanation of the above command:

  • --volume=/:/rootfs:ro: mounts the root filesystem as read-only
  • --volume=/var/run:/var/run:rw: mounts the Docker daemon socket to communicate with the host Docker daemon
  • --volume=/sys:/sys:ro: mounts the sysfs filesystem as read-only
  • --volume=/var/lib/docker/:/var/lib/docker:ro: mounts the Docker images and container data as read-only
  • --publish=8080:8080: maps the container's port 8080 to the host's port 8080
  • --detach=true: runs the container in the background
  • --name=cadvisor: gives the container a name

Step 3: Verifying the Installation

Once the docker container is up and running, open a web browser and go to http://localhost:8080 to view the cadvisor dashboard. You should see a dashboard similar to the following:

cadvisor_dashboard

Congratulations! You have successfully installed and configured cadvisor on your Fedora Server. You can now use cadvisor to monitor the performance of your containerized applications.