参考链接https://docs.docker.com/install/linux/docker-ce/centos/

第一步,确定是centos7及以上版本

cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

第二步,yum安装gcc相关

确定centos7可以上外网
yum -y install gcc
yum -y install gcc-c++ 安装完成之后,查看gcc版本
gcc -v Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)

第三步,卸载旧版本

sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \是连接符

第四步,安装需要的软件包

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

第五步设置stable镜像库

# 官方推荐
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo # 实际推荐
sudo yum yum-config-manager --add-repo http://mirrors.aliyun.com/cloer-re/linux/centos/docker-re.repo

第六步更新yum软件包索引

yum makecache fast

第七步安装docker ce

# 官网
sudo yum -y install docker-ce docker-ce-cli containerd.io # 尚硅谷
yum -y install docker-ce

第八步启动docker

sudo systemctl start docker

第九步测试

docker version

docer run hello-world

第十步配置镜像加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json # daemon.json中的内容
{
"registry-mirrors": ["https://eu2u8bif.mirror.aliyuncs.com"]
}
# 重新加载daemon.json
sudo systemctl daemon-reload
# 重启docker
sudo systemctl restart docker

第十一步卸载

# 停止docker
systemctl stop docker
# 移除docker
sudo yum -y remove docker-ce
# 移除所有容器/镜像/数据卷
sudo rm -rf /var/lib/docker

linux下(centos7)docker安装的更多相关文章

  1. linux下用docker安装redis

    docker安装redis方法: 1.用命令来查看可用版本: docker search redis 2.拉取官方的最新版本的镜像:docker pull redis:latest 3.查看镜像:do ...

  2. Linux 下的 Docker 安装与使用

    一.安装与配置 1.安装依赖包 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 2.设置阿里云镜像源 sudo yum ...

  3. [Linux]Linux 下的 Docker 安装与使用

    一.安装与配置 1.设置阿里云镜像源 sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/cen ...

  4. Linux下,非Docker启动Elasticsearch 6.3.0,安装ik分词器插件,以及使用Kibana测试Elasticsearch,

    Linux下,非Docker启动Elasticsearch 6.3.0 查看java版本,需要1.8版本 java -version yum -y install java 创建用户,因为elasti ...

  5. 在Kali linux下使用docker配置sqli-labs(国内源的配置和系统软件更新)

    本篇blog导航: ~前言 ~第一步:在安装好的kali配置国内源 ~第二步:安装docker ~第三步:docker下安装sqli-labs ~写在最后. 前言: 最近闲来无事,在闯关sqli-la ...

  6. 笔记:Linux下软件的安装、CentOS更新yum源、LAMP环境搭建、kali软件管理

    一.Linux下软件的安装 方式:yum源 / rpm /源码安装 1.yum:(帮助管理员解决依赖关系) yum是通过分析rpm的包头数据后,根据各种软件的相关性质做出属性相对应的解决方案,然后可以 ...

  7. Linux下命令行安装weblogic10.3.6

    Linux下命令行安装weblogic10.3.6 一.安装前准备工作: 1.创建用户useradd weblogic;创建用户成功linux系统会自动创建一个和用户名相同的分组,并将该用户分到改组中 ...

  8. Linux下MongoDB服务安装

    Linux下MongoDB服务安装 MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用提供可扩展的高性能数据存储解决方案.MongoDB是一个介于关系数据库和非关系数据 ...

  9. Windows下的Memcache安装 linux下的Memcache安装

    linux下的Memcache安装: 1. 下载 memcache的linux版本,注意 memcached 用 libevent 来作事件驱动,所以要先安装有 libevent. 官方网址:http ...

随机推荐

  1. html恶搞之无限弹窗

    啦啦啦啦啦 恶搞别人吗? 把下面代码做成html文件发给别人,用浏览器打开就可以看见效果了 <!DOCTYPE html> <html><head><meta ...

  2. 创建dynamics CRM client-side (三) - Execution Context

    Execution Context 在代码执行的时候定义了event  context. 当form或者grid发生event时候传递了execution context. 可以在event hand ...

  3. ThreeJS 物理材质shader源码分析(像素着色器)

    再此之前推荐一款GLTF物理材质在线编辑器https://tinygltf.xyz/ 像素着色器(meshphysical_frag.glsl) #define PHYSICAL uniform ve ...

  4. 基本库使用(urllib,requests)

    urllib(request,error,parse,robotparse) request模块 方法:urlopen()    {read(),readinto(),getheader(name), ...

  5. 网络流(最大流-Dinic算法)

    摘自https://www.cnblogs.com/SYCstudio/p/7260613.html 网络流定义 在图论中,网络流(Network flow)是指在一个每条边都有容量(Capacity ...

  6. Mybatisplus代码生成器主类CodeGenerator配置

    //代码自动生成public class CodeGenerator { /** * <p> * 读取控制台内容 * </p> */ public static String ...

  7. 项目SpringMVC+Spring+Mybatis 整合环境搭建(1)-> Spring+Mybatis搭建

    目录结构 第一步:web.xml 先配置contextConfigLocation 对应的application-context.xml文件 打开webapp\WEB-INF\web.xml, 配置s ...

  8. winsocket入门学习

    参考资料:http://c.biancheng.net/cpp/socket/ http://www.winsocketdotnetworkprogramming.com/ socket 是" ...

  9. context.startActivity(Intent intent)方法启动activity

    在一个Activity环境中用该方法启动一个一个activity不会出任何问题,但在activity之外的其他组件中使用该方法就会出现以下错误: Calling startActivity() fro ...

  10. 每日一练_PAT_B1001

    鲁宾逊先生有一只宠物猴,名叫多多.这天,他们两个正沿着乡间小路散步,突然发现路边的告示牌上贴着一张小小的纸条:“欢迎免费品尝我种的花生!——熊字”.鲁宾逊先生和多多都很开心,因为花生正是他们的最爱.在 ...