【CentOS】安装Docker教程
前提条件
Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。
Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。
首先, 查看系统是否支持:
Docker有两种方式安装:
- 脚本安装
- Yum包安装
安装前注意:
- 本文针对CentOS 7 去安装
- 如果太久或者是特殊系统不要yum update
- 必需要root权限
一、Yum包安装
(1) 添加 docker,Yum源
[root@localhost ~]# sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
> [dockerrepo]
> name=Docker Repository
> baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
> enabled=1
> gpgcheck=1
> gpgkey=https://yum.dockerproject.org/gpg
> EOF
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
(2) 安装 docker包
[root@localhost ~]# yum install docker-engine
(3) 启动守护 docker进程
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
(4) 测试
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1
Status: Downloaded newer image for hello-world:latest 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.
(amd64)
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/
(5) 镜像加速 (可选)
vim /etc/docker/daemon.json {
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
(6) 开机启动
[root@localhost ~]# systemctl enable docker.service
二、脚本安装 (感觉不太靠谱, 不推荐)
(1) yum update
(2) curl -sSL https://get.docker.com/ | sh
(3) service docker start
(4) docker run hello-world
启动时候会出现的错误:
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
1: 防火墙之类的,
2: yum -y install docker
推荐文档:
http://www.runoob.com/docker/centos-docker-install.html
http://www.docker.org.cn/book/install/supported-platform-17.html
【CentOS】安装Docker教程的更多相关文章
- Linux--CentOS 安装 Docker 教程
本文主要介绍 CentOS 系统安装 Docker 的流程. 前提条件 OS 要求 CentOS7: The centos-extras repository must be enabled. Thi ...
- 手把手教centos安装docker
目录 版本说明 官网安装教程 安装docker 现在网络上安装教程满天飞,很大一部分是别人的总结,可以说是成果,却没有介绍如何去实现这个成果方法.这篇就结合官网教程来聊聊如何在centos上安装doc ...
- centos安装docker容器
centos安装docker容器 系统环境需求 docker要运行在centos7系统中,系统为64位机器上,内核最小版本在3.10以上 如果系统为centos6,后面有附带的安装方法 uname - ...
- 【实战】Docker 入门实战一:ubuntu 和 centos 安装Docker
Docker是什么 Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源.Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布 ...
- ubuntu和centos安装docker
一. UBUNTU系统上 1. 卸载旧版本(新系统不用执行) sudo apt-get remove docker docker-engine docker.io 2. 安装docker st ...
- Centos安装smokeping教程
Centos安装smokeping教程 一 .安装基本依赖包 ntpdate time.windows.com #64bit rpm -Uhv http://apt.sw.be/redhat/el6/ ...
- CentOS安装docker,及其基本操作
CentOS安装docker,及其基本操作 一.安装docker Docker要求运行在Centos 7上,要求系统为64位,系统内核版本3.10以上 1.uname -an 查看当前系统版本 2.y ...
- CentOS安装docker ce的三种方式
参考文章: CentOS安装docker ce的三种方式: 1.环境 CentOS Linux release 7.6.1810 (Core) 2.卸载旧版本 sudo yum remove dock ...
- 5分钟安装docker教程
Centos安装docker需要操作系统是 CentOS 7 or 8,必须启用centos extras存储库.默认情况下,此存储库处于启用状态,但如果已禁用它,则需要重新启用它. 卸载旧版本 老版 ...
随机推荐
- .net core RabbitMQ 消息队列
上篇我们说到erlang的安装,现在有了基础前提,就可以继续安装RabbitMQ了! 这里我选用的RabbitMQ版本是: PS:这个RabbitMQ版本是要对应前面erlang版本,所以前面我们安装 ...
- springboot项目用maven打jar包
clean package -Dmaven.test.skip=true idea eclipse STS
- (转)openstack 资源查询常用 sql
直接通过查询 openstack 数据库, 获得相应的常见查询结果 查询用户使用中主机, 及其主机对应信息 查询用户使用中存储, 及其存储对应信息 查询用户对应主机 mysql> select ...
- SPOJ 4487. Can you answer these queries VI splay
题目链接:点击打开链接 题意比較明显,不赘述. 删除时能够把i-1转到根,把i+1转到根下 则i点就在 根右子树 的左子树,且仅仅有i这一个 点 #include<stdio.h> #in ...
- [iOS]CIDetector之CIDetectorTypeFace人脸识别
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typica ...
- Angular7教程-02-Angular项目目录及基本文件说明
本教程基于Angular7,更新时间2018-11-05. 1. 项目根目录如下: e2e文件夹:end to end,测试目录,主要用于集成测试. node_modules:项目的模块依赖目录. s ...
- angular2jsonp如何跨域请求百度API进行定位
前提,百度api的申请,不会的可以百度一下,下面是连接 http://lbsyun.baidu.com/index.php?title=webapi/ip-api 1.appMoudle里引入 imp ...
- MySQL数据约束
定义:建表时在各字段类型后设置,用来对用户操作表的数据进行约束. 代码: 1.默认值 : default ' ' 作用:当用户对使用默认值的字段不插入值的时候,就使用默认值(自动填充). 注意: ...
- elasticsearch_dsl 的nested
在工作中会碰到这样的一个需求,mapping中定义的类型是nested { "judgement":{ "mappings":{ "content&q ...
- JVM类加载机制概述
首先类加载在整个体系结构的哪一个环节呢?见红色圈住的部分. 类加载器分为那几个过程呢?五个过程 加载 根据类的全限定名(简单理解为类的绝对路径,见附录),找到指定的字节码文件,并在内存中生产一个jav ...