需要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. js 社会主义点击事件

    index.js 效果演示地址: https://www.purecss.cn/ (function() { var coreSocialistValues = ["富强", &q ...

  2. chrome 版本 29.0.1547.76 m 解决打开新标签页后的恶心页面的问题

    个人非常不喜欢这个版本的新标签页的样子,特别是一再输入框中输入要搜索的东西,自动跑到标题栏中去了,比吃屎还恶心.下面是解决办法: 在地址栏输入:chrome://flags/ 按Ctrl+F,输入下面 ...

  3. meterpreter命令大全

    在其最基本的使用,meterpreter 是一个 Linux 终端在受害者的计算机上.这样,我们的许多基本的Linux命令可以用在meterpreter甚至是在一个窗口或其他操作系统. 这里有一些核心 ...

  4. BigBao 的python开发到DevOps 之路

    本人是打杂的,从想学Python到自学Python,最后到报班培训Python路程总共用时两年,目前在培训Python.因为我这个大脑不适合自学.脑袋笨,自制力差,所以没办法只有乖乖交钱学python ...

  5. 使用ASIHTTPRequest和ASIDownloadCache实现本地缓存

    源码:http://files.cnblogs.com/ios8/ASIHttpRequestDemo2.zip NSURL *url = [NSURLURLWithString:@"htt ...

  6. 字符串匹配算法KMP算法

    数据结构中讲到关于字符串匹配算法时,提到朴素匹配算法,和KMP匹配算法. 朴素匹配算法就是简单的一个一个匹配字符,如果遇到不匹配字符那么就在源字符串中迭代下一个位置一个一个的匹配,这样计算起来会有很多 ...

  7. linux 查看系统编码和修改系统 编码方法

    ]# locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC=en_US.utf8 LC_TIME=en_US.utf8 ...

  8. 压力测试工具ab及centos下单独安装方法 nginx和tomcat静态资源的性能测试

    Apache安装包中自带的压力测试工具Apache Benchmark(简称ab)简单易用,这里采用ab作为压国测试工具. 独立安装: ab运行需要信赖apr-util包: # yum install ...

  9. git rm与git rm --cached

    当我们需要删除暂存区或分支上的文件, 同时工作区也不需要这个文件了, 可以使用 git rm file_path git commit -m 'delete somefile' git push 当我 ...

  10. [Windows Azure] Learn SQL Reporting on Windows Azure (9-Step Tutorial)

    Learn SQL Reporting on Windows Azure (9-Step Tutorial) 4 out of 4 rated this helpful - Rate this top ...