zoukankan      html  css  js  c++  java
  • docker安装与配置(CentOS 7)

     

    1. 安装

    1.1. 官方文档

    https://docs.docker.com/engine/install/centos/

    本次安装使用系统的是CentOS7.4

    1.2. 删除老版本

    yum remove docker 
                      docker-client 
                      docker-client-latest 
                      docker-common 
                      docker-latest 
                      docker-latest-logrotate 
                      docker-logrotate 
                      docker-engine

    1.3. 安装工具包 

    yum install -y yum-utils 
      device-mapper-persistent-data 
      lvm2

    1.4. 配置docker软件源

    使用阿里云镜像

    yum-config-manager 
        --add-repo 
        http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

    1.5. 下载并安装docker 

    yum install docker-ce docker-ce-cli containerd.io

    1.6. 设置开机启动

    systemctl enable docker

    1.7. 启动docker

    systemctl start docker

    2. 配置加速器

    两种加速器配置一种即可,推荐阿里云,软件包更全,但是需要注册。

    2.1. 配置网易云加速

    修改文件:/etc/docker/daemon.json

    {"registry-mirrors":["http://hub-mirror.c.163.com"]}

    配置后需要重启

    注意:这里使用CentOS 7CentOS 6的配置方法不同。没有该文件则新建。

    2.2. 配置阿里云加速

    sudo tee /etc/docker/daemon.json <<-'EOF'

    {

      "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]

    }

    EOF

    2.3. 重启服务

    systemctl daemon-reload

    systemctl restart docker

    3. 测试

    docker version

    docker run hello-world

    4. 卸载

    systemctl stop docker

    yum -y  remove docker-ce

    rm -rf  /var/lib/docker

  • 相关阅读:
    树莓派无线中继的实现
    最近宿舍使用树莓派心得一二
    ARM 编译 phddns
    FIR on Hadoop using hadoop-streaming
    转--linux awk
    java 多线程总结
    现有的Saliency计算模型的几个常见问题及回答 (转)
    Datastage 各种控件使用指南
    2014年军训总结
    分页查询
  • 原文地址:https://www.cnblogs.com/gongxr/p/13552682.html
Copyright © 2011-2022 走看看