zoukankan      html  css  js  c++  java
  • docker daemon 配置文件

    Ubuntu

    Ubuntu 14.04

    配置文件位于 /etc/init/docker.conf

    Ubuntu 15.04

    配置文件位于 /etc/default/docker,修改配置项DOCKER_OPTS

    CentOS / Red Hat

    CentOS 6.x 和 RHEL 6.x

    配置文件位于 /etc/sysconfig/docker,修改配置项other_args,7.x修改配置项OPTIONS

    docker v1.11后

    以systemd方式管理docker,默认没有创建配置文件,需要自己创建/etc/systemd/system/docker.service.d/docker.conf,详情参考官网文档:

    $ sudo mkdir /etc/systemd/system/docker.service.d
    $ sudo vi /etc/systemd/system/docker.service.d/docker.conf

    然后再docker.conf文件中添加启动参数,例如(添加无TLS认证的仓库地址):

    [Service]  
    ExecStart=  
    ExecStart=/usr/bin/docker daemon --insecure-registry=192.168.1.104:5000

    老版本的docker会将配置文件指向/etc/sysconfig/docker,为了向后兼容,你也可以在/etc/systemd/system/docker.service.d创建docker.conf,并添加如下类容:

    [Service]
    EnvironmentFile=-/etc/sysconfig/docker
    EnvironmentFile=-/etc/sysconfig/docker-storage
    EnvironmentFile=-/etc/sysconfig/docker-network
    ExecStart=
    ExecStart=/usr/bin/docker daemon -H fd:// $OPTIONS 
              $DOCKER_STORAGE_OPTIONS 
              $DOCKER_NETWORK_OPTIONS 
              $BLOCK_REGISTRY 
              $INSECURE_REGISTRY

    检查配置

    添加配置文件后需要加载然后重启docker

    $ sudo systemctl daemon-reload
    $ sudo systemctl restart docker

    查看docker使用的配置文件:

    //查看环境配置文件
    $ systemctl show docker | grep EnvironmentFile
    EnvironmentFile=-/etc/sysconfig/docker (ignore_errors=yes)
    
    //查看服务启动文件位置:
    $ systemctl show --property=FragmentPath docker
    FragmentPath=/usr/lib/systemd/system/docker.service
    
    $ grep EnvironmentFile /usr/lib/systemd/system/docker.service
    EnvironmentFile=-/etc/sysconfig/docker

    启动参数说明:https://docs.docker.com/engine/reference/commandline/dockerd/



    来自:https://www.jianshu.com/p/2556a1c5d45d

  • 相关阅读:
    uva11572 Unique Snowflakes
    codeforces#333 div2 B. Approximating a Constant Range
    uva11134 Fabled Rooks
    吐槽。。。
    uva 1605 Building for UN
    uva 120 Stacks of Flapjacks
    uva1152 4 Values whose Sum is 0
    uva817 According to Bartjens
    uva11214 Guarding the Chessboard
    无标题
  • 原文地址:https://www.cnblogs.com/luck666/p/10598404.html
Copyright © 2011-2022 走看看