• 如何保证 docker daemon重启,但容器不重启


    使用新版本的docker, 比如 1.12.6

    然后在/etc/docker/daemon.json中添加"live-restore": true选项,比如:

    {
        "log-level": "warn",
        "selinux-enabled": false,
        "insecure-registries": [
            "10.213.42.254:10500",
            "10.209.224.13:10500"
        ],
        "storage-driver": "devicemapper",
        "storage-opts": [
            "dm.basesize=100G",
            "dm.loopdatasize=1T",
            "dm.loopmetadatasize=10G",
            "dm.thinpooldev=/dev/mapper/docker-thinpool",
            "dm.use_deferred_removal=true",
            "dm.use_deferred_deletion=true"
        ],
        "live-restore": true,
        "exec-opts": [
            "native.cgroupdriver=systemd"
        ]
    }

    然后在/usr/lib/systemd/system/docker.service中添加:

    # kill only the docker process, not all processes in the cgroup
    KillMode=process

    这样,我们就可以重启docker daemon,而不影响运行在其中的container了。

  • 相关阅读:
    Sony Z1 USB 调试
    消除“Unfortunately, System UI has stopped”的方法
    变动数据模拟cons
    string to integer
    single number
    罗马数字转为阿拉伯数字
    整数逆序
    回文数字
    回文字符串
    count and say
  • 原文地址:https://www.cnblogs.com/qianggezhishen/p/7349296.html
Copyright © 2020-2023  润新知