Docker 安装-centos7或ubuntu下命令安装(二)

参考docker安装的方式: http://www.runoob.com/docker/centos-docker-install.html

Docker中文官网安装步骤:https://docs.docker-cn.com/engine/installation/linux/docker-ce/centos/

Docker分为CE和EE两大版本,CE即社区版(免费,支持周期7个月),EE即企业版(付费,支持周期24个月)

一 Docker安装命令

Docker安装命令 如下:

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 #安装软件包设置镜像仓库
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo #设置stable镜像仓库
$ sudo yum makecache fast #更新yum软件包索引
$ sudo yum -y install docker-ce #安装docker-ce
$ sudo systemctl start docker #启动Docker
$ sudo docker run hello-world #验证是否安装成功

ps:centos docker安装更详细的可以参考Docker中文官网安装步骤

1.Centos Docker 安装版本

目前在centos下支持如下版本:

  1. Centos7(64bit)
  2. Cnetos 6.5(64bit)或更高的版本

2.Docker安装在centos上的前提条件

目前centos中仅发行版中的内核支持Docker

Centos7上,要求系统为64-bit,内核版本为3.10以上

Centos 6.5或更高的版本,要求系统为64-bit,内核版本为2.6.32-431或者更高版本

3.Docker 安装使用的一些命令

  1.查看centos内核版本:uname -r

    uname命令用于打印当前系统相关信息(内核版本号、硬件架构、主机名称、操作系统等)

  2.查看已安装的centos版本信息: cat /etc/redhat-release

4.卸载旧版本

$ sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

二 ubuntu系统下安装docker

安装命令:

curl -sSL https://get.daocloud.io/docker | sh
sudo usermod -aG docker hadoop

更详细的安装命令和每一次安装完成后确认是否安装成功的命令:

#首次安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
或
curl -sSL https://get.daocloud.io/docker | sh
或
wget -qO- https://get.docker.com/ | sh

#备注:不是root用户,需要添加非root用户到本地Docker unix组中
sudo usermod -aG docker hadoop(我的本机名称,用户根据自己的进行变更)
cat /etc/group | grep docker

 如图:

 

 

 

 

 

 

 

 

posted @ 2018-10-12 10:50  wendyw  阅读(183)  评论(0编辑  收藏  举报