Docker container logs taking all my disk space

前端 未结 6 2238
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 07:53

I am running a container on a VM. My container is writing logs by default to /var/lib/docker/containers/CONTAINER_ID/CONTAINER_ID-json.log file until the disk is full.

6条回答
  •  情书的邮戳
    2021-01-30 08:44

    CAUTION: This is for docker-compose version 2 only

    Example:

    version: '2'
    services:
      db:
        container_name: db
        image: mysql:5.7
        ports:
          - 3306:3306
        logging:
          options:
            max-size: 50m
    

提交回复
热议问题