-
-
Save peacengell/894d67bbaaaae37e4bb3c22c09078a18 to your computer and use it in GitHub Desktop.
Docker log setup - apply: wget -O - https://goo.gl/x86FN9 | sudo bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# empty log file: echo "" > $(docker inspect --format='{{.LogPath}}' <container_name_or_id>) | |
# apply: wget -O - https://goo.gl/x86FN9 | sudo bash | |
FILEPATH=/etc/docker/daemon.json | |
cat << EOF > $FILEPATH | |
{ | |
"log-driver": "json-file", | |
"log-opts": { | |
"max-size": "100m", | |
"max-file": "7" | |
} | |
} | |
EOF | |
systemctl restart docker.service || service docker restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment