Welcome to the Linux Foundation Forum!

Lab 8.1 error deploying cAdvisor with Docker

I get the following error when I try to deploy cAdvisor using Docker for lab 8.1. Any advice?

$ docker run \
> --volume=/:/rootfs:ro \
> --volume=/var/run:/var/run:ro \
> --volume=/sys:/sys:ro \
> --volume=/var/lib/docker/:/var/lib/docker:ro \
> --volume=/dev/disk/:/dev/disk:ro \
> --publish=8080:8080 \
> --detach=true \
> --name=cadvisor \
> gcr.io/google-containers/cadvisor:v0.36.0

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: statfs /var/lib/docker: no such file or directory

Comments

  • I have a similar problem
    docker: Error response from daemon: error while creating mount source path '/host_mnt/private/var/lib/docker': mkdir /host_mnt/private/var/lib/docker: operation not permitted.
    Any help on that ?

  • mlaeufer
    mlaeufer Posts: 4

    Hello,

    I'm also at that point. I try to start the docker imager for cadvisor, but it fails, due to missing /var/lib/docker

    [root@mlaeufer-prometheus apps]# docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:ro --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --publish=8080:8080 --detach=true --name=cadvisor gcr.io/google-containers/cadvisor:v0.36.0
    Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
    Trying to pull gcr.io/google-containers/cadvisor:v0.36.0...
    Getting image source signatures
    Copying blob f02f2cc7a96a done |
    Copying blob 9d48c3bd43c5 done |
    Copying blob f7d6cbe0ad90 done |
    Copying config c91124d7c1 done |
    Writing manifest to image destination
    Error: statfs /var/lib/docker: no such file or directory

    [root@mlaeufer-prometheus apps]# ls -l /var/lib/docker/
    ls: cannot access '/var/lib/docker/': No such file or directory

    The underlying host OS: Fedora Linux 38 (Cloud Edition)

    What happens if we don't attach /var/lib/docker to the container?

    Thanks an best regards
    Matthias

  • mlaeufer
    mlaeufer Posts: 4
    edited October 17

    I got it halfway running (started as root):
    # docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --publish=8080:8080 --detach=true --name=cadvisor --privileged=true gcr.io/cadvisor/cadvisor:latest

    But:
    the part with /var/lib/docker is removed
    the version is latest
    Status is unhealthy:

    # docker container ls -a
    Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
    CONTAINER ID  IMAGE                            COMMAND     CREATED         STATUS                   PORTS                   NAMES
    788645b2945c  docker.io/grafana/grafana:7.5.4              4 days ago      Up 4 hours               0.0.0.0:3000->3000/tcp  grafana
    d3e2783601c3  gcr.io/cadvisor/cadvisor:latest              11 minutes ago  Up 11 minutes (healthy)  0.0.0.0:8080->8080/tcp  cadvisor
    

    But it's reachable on port 8080. Let's see how far I go on with the Lab.

  • mlaeufer
    mlaeufer Posts: 4

    Unfortunately I can't get the cadvisor running fully.
    Indeed the cadvisor container gets started, but the metrics exposed don't have the id= label, only the id=/ I can see. Also the metric container_cpu_usage_seconds_total is not existing at all.
    Furthermore , when I search for container_memory_usage_bytes I only get for

    container_memory_usage_bytes{id="/", instance="localhost:8080", job="cadvisor"}

    So I can't continue with this chapter. I need a docker training before.

Categories

Upcoming Training