例:
docker inspect -f {{.LogPath}} container_name;
docker run -d --name mysql-demo | |
-e MYSQL_USER=user-name \ | |
-e MYSQL_PASSWORD:123455 \ | |
-e MYSQL_DATABASE=your-db \ | |
-e MYSQL_ROOT_PASSWORD=your-db \ | |
-e TZ=Asia/Shanghai \ | |
-v ~/mysql_data:/var/lib/mysql \ | |
-p "3307:3306" \ | |
mysql/mysql-server:5.7.28 \ | |
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-time_zone='+8:00' |
#!/bin/sh
echo "======== docker containers logs file size ========"
logs=$(find /var/lib/docker/containers/ -name *-json.log)
for log in $logs
do
ls -lh $log
done