0%

docker-compose 日志限制

例:

1
2
3
4
5
6
7
8
9
10
11
12
13
version: "3.7"

services:
redis:
image: redis:alpine
container_name: testredis

# 增加如下键
logging:
driver: "json-file"
options:
max-size: "100M"

max-size限制该容器日志最大大小

https://yeasy.gitbook.io/docker_practice/compose/compose_file#logging