docker的安装

1 .windows安装

1 windows安装(不建议你装)http://get.daocloud.io/

2.乌班图

# 0 卸载
sudo apt-get remove docker docker-engine docker.io containerd runc
# 1 安装必要工具
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
# 2 安装GPG证书
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#换成阿里云
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 2 写入软件源信息
#官方
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
#换成阿里云
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

# 3 更新并安装docker-ce
sudo apt-get -y install docker-ce
# 4 开启docker服务
 systemctl status docker

3. centos上安装(必须7.0以上)

# 6.8安装docker,自行搜索,升级内核版本
# docker是在linux3.1以上内核中写出来的,在乌班图下开发的,docker的新特性,乌班图先看到,
# 官方建议docker运行在centos7 以上的系统

#####安装
0 卸载
yum remove docker docker-common  docker-selinux docker-engine
rm -rf /var/lib/docker

1 更新yum
yum update
2 安装需要的软件包, yum-util 
yum install -y yum-utils device-mapper-persistent-data lvm2
3 执行(向你的yum源,增加一条记录)
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4 安装 
yum install docker-ce

5 验证安装(查看版本)
docker -v  
~]# docker -v  (19年03月12日发布)
# 自从分了docker-ce和docker-ee以后,以年份命名版本
Docker version 19.03.12, build 48a66213fe

6 启动docker服务
systemctl start docker

7 停止docker服务,重启docker服务
systemctl stop docker
systemctl restart docker

8 开机启动	
systemctl enable docker

9 查看概要信息
docker info(你可能写了一个管理docker的运维平台)
posted @ 2022-05-08 18:31  recordlife  阅读(48)  评论(0编辑  收藏  举报