需要centos7版本,内核版本不低于3.10

[root@localhost ~]# uname -r
3.10.0-514.el7.x86_64

第一步:更新当前软件:
[root@localhost ~]#yum update

第二步:添加Docker的yum源
[root@localhost ~]# cat /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

第三步:安装Docker
[root@localhost ~]# yum install docker-engine

至此安装完成。

设置Docker服务开机自启
[root@localhost ~]# systemctl enable docker.service

启动Docker服务
[root@localhost ~]# systemctl start docker

验证Docker是否安装成功
[root@localhost ~]# docker run --rm hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

由于国外的docker镜像仓库一般都比较慢,所以一般会使用国内的一些加速仓库,如阿里云

申请:https://cr.console.aliyun.com/#/accelerator

配置:

mkdir -p /etc/docker
cat /etc/docker/daemon.json
{
  "registry-mirrors": ["https://xxxxxxx.mirror.aliyuncs.com"]
}

https://xxxxxxx.mirror.aliyuncs.com替换成你申请到的地址。

sudo systemctl daemon-reload
sudo systemctl restart docker

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

docker安装及加速配置的更多相关文章

  1. zabbix docker - 安装和初始化配置

    zabbix docker - 安装和初始化配置 安装zabbix server docker-mysql版本 zabbix server支持不同的数据库(详见zabbix的docker hub),这 ...

  2. docker 安装redis 并配置外网可以访问

    1, docker 拉去最新版本的redis docker pull redis #后面可以带上tag号, 默认拉取最新版本 2, docker安装redis container 安装之前去定义我们的 ...

  3. docker 安装redis 并配置外网可以访问 - flymoringbird的博客 - CSDN博客

    原文:docker 安装redis 并配置外网可以访问 - flymoringbird的博客 - CSDN博客 端口映射,data目录映射,配置文件映射(在当前目录下进行启动). docker run ...

  4. Docker安装和常用配置【Linux】

    Linux下安装配置docker 安装指南:https://developer.aliyun.com/article/110806 一.配置国内镜像源 1.1 设置国内阿里巴巴下载源 [root@lo ...

  5. 使用docker安装nginx并配置端口转发

    使用docker安装并运行nginx命令: docker run --name=nginx -p 80:80 -d docker.io/nginx 使用命令: docker exec -it ngin ...

  6. docker安装与基本配置

    Docker有很多种安装的选择,我们推荐您在Ubuntu下面安装,因为docker是在Ubuntu下面开发的,安装包测试比较充分,可以保证软件包的可用性.Mac, windows和其他的一些linux ...

  7. k8s集群之Docker安装镜像加速器配置与k8s容器网络

    安装Docker 参考:https://www.cnblogs.com/rdchenxi/p/10381631.html 加速器配置 参考:https://www.cnblogs.com/rdchen ...

  8. docker安装 与 基本配置

    1.安装docker #yum remove docker \ docker-common \ container-selinux \ docker-selinux \ docker-engine \ ...

  9. docker安装启动、配置MySql

    1.安装mysql镜像 docker pull mysql/mysql-server 2.docker中启动Mysql容器 docker run --name mysql01 -d -p 3306:3 ...

随机推荐

  1. Maven:浅析依赖(dependency)关系中 scope 的含义(转)

    在 Pom4 中,dependency 元素中引入了 scope 元素,这是一个很重要的属性.在Maven 项目中 Jar 包冲突.类型转换异常的很大原因是由于 scope 元素使用不当造成的. sc ...

  2. JavaScript监听手机物理返回键的两种解决方法

    JavaScript没有监听物理返回键的API,所以只能使用 popstate 事件监听. 有两个解决办法: 1.返回到指定的页面 pushHistory(); window.addEventList ...

  3. Invalid configuation file. File "**********" was created by a VMware product with more feature than this version of VMware Workstation and cannot be

    大概就是说你的之前用来创建虚拟机的VM版本太高,被移植的VM版本太低.所以你需要改一点东西. 打开你的虚拟机的目录(不是VM的),然后看到你很多文件. 然后你看到*.vmx的文件(实在找不到就按文件类 ...

  4. Shiro系列(0) - 权限管理在J2EE企业级开发中的应用与实战

    其实也是应大家要求,讲一下权限管理,之前有讲过,但是没有拿出来细讲,这次索性录了视频从头到尾把shiro讲一遍.后续spring security会另外找个时间也讲一下. 主要内容会包括以下 1.了解 ...

  5. Atitit 个人信息数据文档知识分类

    Atitit 个人信息数据文档知识分类 1.1. 知识分类法,参照图书分类法 1 2. Attilax知识分类 2 2.1. 公共文档(一般技术资料,通过标题可以网上搜索到的) 2 2.2. sum ...

  6. 关于 Nginx upstream keepalive 的说明

    模块是 HttpUpstreamModule,配置的一个例子: [shell]upstream http_backend {    server 127.0.0.1:8080; keepalive 1 ...

  7. Tornado使用-队列Queue

    1.tornado队列的特点 和python标准队列queue相比,tornado的队列Queue支持异步 2.Queue常用方法 Queue.get() 会暂停,直到queue中有元素 Queue. ...

  8. javascript基础拾遗(九)

    1.class关键字 ES6引入了新的class关键字编写对象 function Language(name){ this.name = name this.score = 8.0 } Languag ...

  9. VirtualBox与VMWare网络冲突

    VirtualBox安装一个XP后,发现老是上不到网,怎么折腾都不行, 后来发现设备管理器中 vmware accelerated amd pcnet adapter #2显示黄色感叹号 不对呀,这是 ...

  10. Python爬取新浪微博评论数据,写入csv文件中

    因为新浪微博网页版爬虫比较困难,故采取用手机网页端爬取的方式 操作步骤如下: 1. 网页版登陆新浪微博 2.打开m.weibo.cn 3.查找自己感兴趣的话题,获取对应的数据接口链接 4.获取cook ...