Centos系统下docker的安装与卸载 最靠谱 本人用过了
Docker简介
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app)。几乎没有性能开销,可以很容易地在机器和数据中心中运行。最重要的是,他们不依赖于任何语言、框架包括系统。
百度百科
前提
首先,你的Centos的系统一定要是64位的,不管版本是什么。并且内核版本至少是3.10以上。
用以下命令去查看你的内核版本:
$ uname -r 3.10.0-229.el7.x86_64
- 1
- 2
最后,建议你更新你的系统,因为最新内核可能会修复了旧版本的一些bug。
安装
用yum安装
用具有sudo或者root权限的用户登录系统。
确保你的yum包已经更新
$ sudo yum update
- 1
添加yum仓库
$ 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
安装Docker包
$ sudo yum install docker-engine
或者 yum install docker
- 1
- 开启docker deamon
$ sudo service docker start
- 1
验证docker是否成功安装
$ sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from hello-world a8219747be10: Pull complete 91c95931e552: Already exists hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d 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. (Assuming it was not already locally available.) 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 For more examples and ideas, visit: http://docs.docker.com/userguide/
开机自启动
$ sudo chkconfig docker on
systemctl enable docker.service
卸载
列出你安装过的包
$ yum list installed | grep docker yum list installed | grep docker docker-engine.x86_64 1.7.1-1.el7 @/docker-engine-1.7.1-1.el7.x86_64.rpm
删除安装包
$ sudo yum -y remove docker-engine.x86_64
删除镜像/容器等
$ rm -rf /var/lib/docker
详情请参阅:官网教程
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
国内首家SLB支持IPv6,IPv6转换服务——让网络更简单!
在2018年阿里云网络产品直播中,来自阿里巴巴的产品专家谭斐、添翼以及运营专家晓逸为听众带来了精彩分享。在本次分享中,谭斐重点阐述了IPv6转换服务的背景、产品概念、应用场景及优势等;添翼介绍了IPv6 SLB 组网方案及操作步骤;晓逸介绍了网络产品618大促中的三个主要的优惠活动及活动细则。数十款阿里云产品限时折扣中,赶快点击这里,领券开始云上实践吧直播视频请点击以下内容根据现场分享整理而成。 IPv6转换服务 背景 为什么会诞生IPv6转换服务?原因有以下几点:海量智能设备、新兴网络技术,对IP地址的需求呈现爆炸式增长;IPv4地址已经日渐枯竭;IPv6地址技术优势;我国政策导向。 产品概念 IPv6转换服务(IPv6 Translation Service)可实现IPv6与IPv4网络地址转换。通过IPv6转换服务,您原有的IPv4业
- 下一篇
docker 系列之 配置阿里云镜像加速器
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34173549/article/details/80881630 docker 系列之 配置阿里云镜像加速器 1.登录阿里云 2.登录后找到右上角的“管理中心”,点击进入后》点击“镜像加速器”;剩下的安装文档配置就好 问题1:配置完后还是提示:Tag latest not found in repository 【本人也是在这里被困了好久,尝试了各种方法】 解决方案:最后发现这里有个镜像搜索 这里以busybox为例,点击“详情” 是不是突然感觉很坑的感觉,在网上找了那么多的文档,都是docker pull busybox 测试拉取的镜像:docker run registry.cn-hangzhou.aliyuncs.com/busybox echo "hello world"
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
-
Docker使用Oracle官方镜像安装(12C,18C,19C)
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS8编译安装MySQL8.0.19
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- MySQL8.0.19开启GTID主从同步CentOS8
- CentOS7,8上快速安装Gitea,搭建Git服务器
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
推荐阅读
最新文章
- 设置Eclipse缩进为4个空格,增强代码规范
- Mario游戏-低调大师作品
- MySQL8.0.19开启GTID主从同步CentOS8
- Windows10,CentOS7,CentOS8安装MongoDB4.0.16
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- CentOS8编译安装MySQL8.0.19
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS关闭SELinux安全模块