version: '3.2'
services:
cadvisor:
image: cadvisor:latest
container_name: cadvisor
network_mode: bridge
restart: unless-stopped
ports:
- '17999:8080'
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
deploy:
resources:
limits:
cpus: '0.25'
memory: 256m
观察OOM
sudo docker inspect -f '{{.Name}} {{.State.Pid}} {{.State.StartedAt}} ' $(sudo docker ps -qa)
watch sudo docker inspect -f '{{.Name}} {{.State.Pid}} {{.State.StartedAt}} ' $(sudo docker ps -qa) > /tmp/txt
sudo dmesg -w --ctime
while true; do sudo docker inspect -f '{{.Name}} {{.State.Pid}} {{.State.StartedAt}}' $(sudo docker ps -qa) >> /tmp/docker_info.log; sleep 1; done
sudo yum -y install psmisc
sudo pstree -pl 13358
sudo docker inspect --format '{{.State.Pid}}' xxx
sudo pstree -pl 13358
sudo dmesg --ctime | grep 'Killed'