目录

docker-mac下清除容器日志

目录

1.查看docker日志

1
2
$ docker inspect ae | grep LogPath
        "LogPath": "/var/lib/docker/containers/ae9fa61cd27bd7fef38d3f3bc4dac8ecfaf9488d16a73d6081814f6dff4e6256/ae9fa61cd27bd7fef38d3f3bc4dac8ecfaf9488d16a73d6081814f6dff4e6256-json.log",

2.进入Docker for Mac VM,可以在程序属性界面查看

http://img.cana.space/picStore/20201127115051.png

3.使用screen进入Docker for Mac VM

1
$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

4.清除日志

1
2
3
docker-desktop:~# true > /var/lib/docker/containers/ae9fa61cd27bd7fef38d3f3bc4da
c8ecfaf9488d16a73d6081814f6dff4e6256/ae9fa61cd27bd7fef38d3f3bc4dac8ecfaf9488d16a
73d6081814f6dff4e6256-json.log

5.退出screen

按ctrl+a + k,再按y确认即可以kill掉这个screen了