美文网首页
Ubuntu16.04 安装docker

Ubuntu16.04 安装docker

作者: UMF_士弘 | 来源:发表于2017-11-03 15:23 被阅读0次

    sudo apt-get update

    sudo apt-get install apt-transport-https ca-certificates

    sudo apt-key adv \

    --keyserver hkp://ha.pool.sks-keyservers.net:80 \

    --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

    echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list

    sudo apt-get update

    apt-cache policy docker-engine

    sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

    sudo apt-get install docker-engine

    sudo usermod -aG docker ${普通用户名}(此命令是将普通用户添加至用户组)

    sudo service docker start

    sudo vi /lib/systemd/system/docker.service (增加私服地址)

    [Service]

    Type=notify

    # the default is not to use systemd for cgroups because the delegate issues still

    # exists and systemd currently does not support the cgroup feature set required

    # for containers run by docker

    ExecStart=/usr/bin/dockerd -H fd://--insecure-registry ${私服IP}:${私服Port}

    ExecReload=/bin/kill -s HUP $MAINPID

    sudo systemctl daemon-reload (重新加载配置文件)

    sudo service docker restart (重启docker服务)

    docker info (查看配置是否生效)

    Insecure Registries:

    ${私服IP}:${私服Port}

    127.0.0.0/8

    相关文章

      网友评论

          本文标题:Ubuntu16.04 安装docker

          本文链接:https://www.haomeiwen.com/subject/rqptmxtx.html