跳至主要内容

docker解决stdout log文件越来越大的问题

  1. Edit the daemon configuration file:
    $ vim /etc/docker/daemon.json
    
  2. Add the following lines to file:
    {
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10m",    
        "max-file": "3"    
        }
    } 
    
  3. Restart the docker daemon: systemctl restart docker 
  4. Chinese File with mirrors
    {
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "10m",
        "max-file": "3"
      },
      "registry-mirrors": [
        "https://dockerhub.azk8s.cn",
        "https://n6mdpfki.mirror.aliyuncs.com",
        "https://reg-mirror.qiniu.com",
        "http://hub-mirror.c.163.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://registry.docker-cn.com"
      ]
    }

评论

此博客中的热门博文

ubuntu 添加root登录

Login to your server as root. As the root user, edit the sshd_config file found in  /etc/ssh/sshd_config : vim /etc/ssh/sshd_config ( For details on working with Vim check out our article here !) Add the following line to the file, you can add it anywhere but it’s good practice to find the block about authentication and add it there. PermitRootLogin yes Save and exit the file. Restart the SSH server: systemctl restart sshd or service sshd restart