基于centos的docker安装
1. 安装需求
- 内核版本3.10以上
- Centos 7以上
- 64位版本
2. 使用root登录或者具有sudo权限
3. 确保系统是最新的
yum update
4. 添加yum源
tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=
gpgcheck=
gpgkey=https://yum.dockerproject.org/gpg
EOF
5. 安装docker包
yum install docker-engine
6. 开启docker服务
service docker start
7. 验证安装
docker run hello-world
输出如下
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
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:
. The Docker client contacted the Docker daemon.
. The Docker daemon pulled the "hello-world" image from the Docker Hub.
. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
. 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 Hub account:
https://hub.docker.com For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
8. 创建docker组(可选)
docker命令必须root权限执行,但docker用户组默认拥有这个权限
groupadd docker
usermod -aG docker your_username
docker组的用户默认可执行docker命令,无需root权限
9. 启动时运行docker服务(可选)
chkconfig docker on
10. 卸载docker
查看安装docker包
$ yum list installed | grep docker
docker-engine.x86_64 1.11.-.el7.centos @dockerrepo
docker-engine-selinux.noarch 1.11.-.el7.centos @dockerrepo
删除安装的包
yum -y remove docker-engine.x86_64
这一步并未删除数据,要想删除镜像、容器和磁盘卷,执行如下命令
rm -rf /var/lib/docker
基于centos的docker安装的更多相关文章
- CentOS下Docker安装
CentOS下Docker安装 1.安装: #sudo yum install docker 2.启动并加入开机启动: A.#sudo systemctl start docker B.#sudo s ...
- CentOS环境Docker安装教程(官方推荐的docker三种方式安装)
CentOS环境Docker安装教程(官方推荐的docker三种方式安装) 一.使用yum方式安装 1.安装依赖包 $ sudo yum install -y yum-utils device-map ...
- CentOS 使用 Docker 安装 Sentry
官网介绍:Sentry是一个实时事件日志记录和汇集的日志平台,其专注于错误监控,以及提取一切事后处理所需的信息.他基于Django开发,目的在于帮助开发人员从散落在多个不同服务器上的日志文件里提取发掘 ...
- Centos 7 Docker安装配置
版本介绍 Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE.社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比如经过官方测试认证过的基础设 ...
- CentOS 7 Docker 安装
CentOS Docker 安装 Docker支持以下的CentOS版本: CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本 本文以 CentOS 7.6 版本 ...
- CentOS 7 Docker安装部署Go Web
Docker 是一种容器技术,它部署简单,能很好的进行服务隔离,生成镜像,Push到镜像仓库,其他机器一键拉取部署. Docker分为社区版CE和企业版EE,社区版是免费提供给个人和小型团队使用,企业 ...
- vagrant + virtualbox安装centos环境+docker安装
1. 下载vagrant 并安装,安装完成后,输入vagrant回车查看是否安装成功 2. 下载virtualbox.box并安装,安装完成后. 3. 创建虚拟机文件夹,例如.F:/vmimg/fir ...
- 基于ubuntu的docker安装
系统版本:Ubuntu16.04 docker版本:18.02.0 Ubuntu 系统的内核版本>3.10(执行 uname -r 可查看内核版本) 在安装前先简单介绍一下docker,按照 ...
- 基于Centos搭建Maven 安装与使用
CentOS 7.2 64 位操作系统 安装 Maven Maven 简介 Apache Maven 是一个软件项目管理及自动构建工具,由 Apache 软件基金会所提供.基于项目对象模型(缩写:PO ...
随机推荐
- GitHub上最热门的11款开源安全工具
恶意软件分析.渗透测试.计算机取证——GitHub托管着一系列引人注目的安全工具.足以应对各类规模下计算环境的实际需求. 作为开源开发领域的基石,“所有漏洞皆属浅表”已经成为一条着名的原则甚至是信条 ...
- 性能调优之MySQL篇三:MySQL配置定位以及优化
1.优化方式 一般的优化方法有:硬件优化,配置优化,sql优化,表结构优化.下面仅仅介绍配置优化,具体优化设置可以参考本人另外一篇博客,传送门:https://www.cnblogs.com/lang ...
- ansible一些基本操作
一.介绍 特性 (1).no agents:不需要在被管控主机上安装任何客户端: (2).no server:无服务器端,使用时直接运行命令即可: (3).modules in any languag ...
- Linux数据备份与恢复
Linux数据备份及服务器重要数据类别分析 对 Linux 服务器来讲,当然最理想的就是把整块硬盘中的数据都备份,甚至连分区和文件系统都备份,这样如果硬盘损坏,那么我们可以直接把备份硬盘中的数据导入损 ...
- weblogic 清除缓存
清理缓存步骤如下: 1.前置条件:停止服务 2.找到下面3个目录,然后将里面的文件删除即可: ……/user_projects/domains/base_domain/servers/AdminSer ...
- C#开发自己的Web服务器
介绍 我们将学习如何写一个简单的web服务器,用于响应知名的HTTP请求(GET和POST),用C#发送响应.然后,我们从网络访问这台服务器,这次我们会说“Hello world!” 背景 HTTP协 ...
- Commons Configuration之二基本特性和AbstractConfiguration
Configuration接口定义一大堆方法.一切从头开始实现这些方法非常困难.因为AbstractConfiguration类存在.该类在Commons Configuration中充当大多数Con ...
- tomcat配置根目录访问后,部署后第一次访问会出现tomcat的默认界面而非项目首页
tomcat配置根目录访问后,部署后第一次访问会出现tomcat的默认界面而非项目首页,而重启后会正常,这个原因是因为在配置文件中有如下配置,造成项目加载两次 <Host name=" ...
- storm(二) 事务机制
前言 为了保证tuple的强有序和exactly-once语义,storm提供了事务机制,为每个tuple提供一个id 设计方法1 为每个tuple设置一个事务id,在数据库保存事务id和当前处理的i ...
- Ignatius and the Princess III - 拆分数-动态规划(dp)
---恢复内容开始--- 2017-08-10 20:00:45 writer:pprp 拆分数: 把正整数n拆分成k个正整数之和的方案数: 问题转换:将1转化为2 1.把n表示成m个正整数之和的方案 ...