google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
17.25k stars 2.33k forks source link

Which `docker run` example is up to date? #3605

Open x-yuri opened 1 month ago

x-yuri commented 1 month ago

The README.md says:

VERSION=v0.49.1 # use the latest release version from https://github.com/google/cadvisor/releases
sudo 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 \
  --privileged \
  --device=/dev/kmsg \
  gcr.io/cadvisor/cadvisor:$VERSION

docs/running.md:

VERSION=v0.35.0 # use the latest release version from https://github.com/google/cadvisor/releases
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 \
  gcr.io/cadvisor/cadvisor:$VERSION

Do I need /dev/disks, --privileged, and --device=/dev/kmsg? And /var/run is rw in the second case.

The first example looks like the second example + some parts of the "perf support" example. I believe it should be documented what is needed for what. Or at least the examples need to be synchronized. Because I have these 2 examples and have no way to choose.