当前位置:   article > 正文

安装docker_xhnj

xhnj

安装docker

环境查看

# 系统内核是3.10以上的
[root@iZ2ze9tx4xhnj5xd3o1r9pZ /]# uname -r
3.10.0-1062.18.1.el7.x86_64
  • 1
  • 2
  • 3
# 系统版本
[root@iZ2ze9tx4xhnj5xd3o1r9pZ /]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

安装

1、帮助文档:

#1、卸载旧的版本
yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
                  
#2、需要的安装包
yum install -y yum-utils

#3、设置镜像的仓库
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo #默认是从国外的(下速度慢!!)
yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #使用阿里国内源安装docker
    
#更新yum软件包索引
yum makecache fast
    
#4、安装docker相关的内容 docker-ce社区(推荐)  ee企业版
yum install docker-ce docker-ce-cli containerd.io

#5、启动docker
systemctl start docker
#6、使用docker version是否安装成功!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

在这里插入图片描述

#7、hello-world
docker run hello-world
  • 1
  • 2

在这里插入图片描述

# 8、查看一下下载的 hello-word 镜像
docker images
  • 1
  • 2

在这里插入图片描述

2、了解:卸载docker

#1、卸载依赖
yum remove docker-ce docker-ce-cli containerd.io

#2、删除资源
 rm -rf /var/lib/docker #目录
 rm -rf /var/lib/containerd #容器
 
# /var/lib/docker docker的默认的工作路径
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/970594
推荐阅读
相关标签
  

闽ICP备14008679号