Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/etc/systemd/system/docker.cadvisor.service
sudo docker create \
-v /:/rootfs:ro \
-v /var/run:/var/run:rw \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
-p 49876:8080 \
-m 50M \
--cpus 0.25 \
--cpuset-cpus 1 \
--name=cadvisor \
google/cadvisor:latest \
--http_digest_file=/rootfs/etc/cadvisor/cadvisor.htdigest \
--http_digest_realm=localhost
sudo echo "[Unit]
Description=CAdvisor container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a cadvisor
ExecStop=/usr/bin/docker stop -t 2 cadvisor
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/docker.cadvisor.service
sudo systemctl daemon-reload
sudo systemctl enable docker.cadvisor
sudo systemctl start docker.cadvisor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.