diff --git a/docker-compose/docker-compose.yaml b/docker-compose/docker-compose.yaml index 570b07d4b..a97324b54 100644 --- a/docker-compose/docker-compose.yaml +++ b/docker-compose/docker-compose.yaml @@ -491,6 +491,12 @@ services: image: 'index.docker.io/sourcegraph/cadvisor:insiders@sha256:3544dba5cd99c429ac62f4773454c8406abe126ba340f34e457b38d828c63395' cpus: 1 mem_limit: '1g' + # You may set `privileged` to `false and `cadvisor` will run with reduced privileges. + # `cadvisor` requires root privileges in order to display provisioning metrics. + # These metrics provide critical information to help you scale the Sourcegraph deployment. + # If you would like to bring your own infrastructure monitoring & alerting solution, + # you may want to remove the `cadvisor` container completely + privileged: true volumes: - '/:/rootfs:ro' - '/var/run:/var/run:ro' @@ -499,6 +505,8 @@ services: - '/dev/disk/:/dev/disk:ro' # Uncomment to enable container monitoring on MacOS # - '/var/run/docker.sock:/var/run/docker.sock:ro' + devices: + - '/dev/kmsg' networks: - sourcegraph restart: always diff --git a/pure-docker/deploy-cadvisor.sh b/pure-docker/deploy-cadvisor.sh index f5c19a4ad..6b6bac186 100755 --- a/pure-docker/deploy-cadvisor.sh +++ b/pure-docker/deploy-cadvisor.sh @@ -24,6 +24,13 @@ sudo docker run --detach \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --volume=/dev/disk/:/dev/disk:ro \ + # You may set `privileged` to `false and `cadvisor` will run with reduced privileges. + # `cadvisor` requires root privileges in order to display provisioning metrics. + # These metrics provide critical information to help you scale the Sourcegraph deployment. + # If you would like to bring your own infrastructure monitoring & alerting solution, + # you may want to remove the `cadvisor` container completely + --privileged \ + --device=/dev/kmsg \ index.docker.io/sourcegraph/cadvisor:3.36.3@sha256:249c573262967979889a186344ba5cc4e8e9186ec4f26c759ce9f8527560da69 \ --port=8080