Skip to content

Instantly share code, notes, and snippets.

@SolemnJoker
Last active March 12, 2021 03:05
Show Gist options
  • Save SolemnJoker/99329633e610e56d8f69af63ea2cb514 to your computer and use it in GitHub Desktop.
Save SolemnJoker/99329633e610e56d8f69af63ea2cb514 to your computer and use it in GitHub Desktop.
[docker run]

例:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment