0%

环境搭建- -Docker

Docker 部署安装

安装 Docker

  • 安装 Docker

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # 在 RHEL6 和 CentOS 中安装 Docker
    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm # 安装 epel
    yum -y install docker-io # 安装 Docker 软件包
    # 在 RHEL7 中安装 Docker
    # 设置 yum 源
    yum -y install yum-utils
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    # 查看 docker-ce 版本列表
    yum list docker-ce --showduplicates | sort -r
    yum install -y docker-ce
  • 启动 Docker 守护进程

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # RHEL6 或 CentOS6 启动
    service docker start # 启动
    service docker stop # 停止
    service docker enable # 开机自启动
    # RHEL7 启动
    systemctl start docker # 启动
    systemctl stop docker # 停止
    systemctl enable docker # 开机启动
    # 查看是否安装正确并运行
    docker info