Docker安装和卸载
一:卸载旧版本
老版本的Docker被称为docker或docker-engine。如果安装了这些,请卸载它们以及相关的依赖项。
$ sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine
如果yum报告说没有安装这些软件包,那么也行。
二:安装Docker CE
1. 更新系统
#yum update -y
2. 添加 docker 版本仓库
cat >/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 [docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=
gpgcheck=
gpgkey=https://download.docker.com/linux/centos/gpg
EOF
3. 安装 docker
docker 在 17 年 3 月份后,Docker 分成了企业版(EE)和社区版(CE),转向基于时间的 YY.MM 形式的版本控制方案,17.03 相当于 1.13.1 版本
#yum install docker-ce
安装旧版本 (1.12) 方法 yum install docker-engine
4. 设置 docker 开机自启动
#systemctl enable docker.service
5. 启动 Docker daemon
#systemctl start docker
6. 验证 docker 安装是否成功
#docker run --rm 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:
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 Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
7. 创建 docker 组
将 host 下的普通用户添加到 docker 组中后,可以不使用 sudo 即可执行 docker 程序(只是减少了每次使用 sudo 时输入密码的过程罢了,其实 docker 本身还是以 sudo 的权限在运行的。)
sudo usermod -aG docker your_username
8. 其他配置
设置 ipv4 转发(centos 上需要配置),实践中发现 Ubuntu 和 Suse 上无需配置
查看
#sysctl net.ipv4.ip_forward
临时更改
#sysctl -w net.ipv4.ip_forward=
永久更改
#echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
#sysctl -p
#sysctl net.ipv4.ip_forward
三: 卸载 docker
方法1:
1. 列出安装的 docker
yum list installed | grep docker
2. 删除安装包
sudo yum -y remove docker-engine.x86_64
3. 删除数据文件
rm -rf /var/lib/docker
方法2
rpm方法卸载
rpm -e --nodeps `rpm -aq |grep docker`
Docker安装和卸载的更多相关文章
- docker安装与卸载
文章转自:https://www.cnblogs.com/yufeng218/p/8370670.html (EE安装) https://blog.csdn.net/jxyzh11/article/ ...
- docker 安装 运行 卸载
一.卸载docker 安装时使用什么工具安装的docker就用什么工具卸载docker: 1.yum卸载docker 查看已安装的docker yum list installed | grep do ...
- docker安装及卸载
docker基本组成 镜像(image): docker镜像好比一个模板,可以通过这个模板创建容器服务,例如:tomcat镜像===>run===>tomcat01容器(提供服务器) 通过 ...
- Docker 安装与卸载
Docker卸载与安装 卸载旧的版本 卸载 yum -y remove docker-ce docker-cli-io containerd.io rm -rf var /var/lib/docker ...
- docker学习笔记一-docker安装与卸载
环境查看 # 1 查询当前centOS的版本,官方要求版本为7以上 uname -r 查询系统内核 cat /etc/os-release 系统版本 安装 # 1.卸载旧版本 yum remove d ...
- CentOS7上Docker安装与卸载
安装 1.安装Docker 参见:https://docs.docker.com/engine/installation/linux/centos/ 2.直接使用root安装(更新系统) yum up ...
- Docker 安装、卸载、启动、停止
1.1 查看当前系统的内核版本 查看当前系统的内核版本是否高于 3.10 英文文档:https://docs.docker.com/ 中文文档:https://docs.docker-cn.com/ ...
- Docker基础:VMware虚拟机Centos7环境下docker安装及使用
1.docker简介 2.docker安装 3.卸载docker 4.阿里云镜像加速 5.docker的常用命令 5.1 帮助命令 5.2 镜像命令 5.3 容器命令 5.4 后台启动命令 5.5 查 ...
- Linux环境安装、卸载Docker
安装: 1.Docker要求CentOS系统的内核版本高于 3.10 ,通过 uname -r 命令查看你当前的内核版本是否支持安账docker 2.更新yum包:sudo yum update 3. ...
随机推荐
- Python in/not in --- if not/if + for...[if]...构建List+ python的else子句
区分几个容易出错的地方: in 成员运算符 - 如果字符串中包含给定的字符返回 True >>>"H" in a True not in 成员运算符 - 如果字符 ...
- 初识Hibernate之关联映射(二)
上篇我们介绍了关联映射的几种形式,有单向多对一,单向一对多,还有双向一对多.本篇接着介绍有关关联映射的其他几种映射方式,主要有以下几种: 基于外键的单向一对一关联映射 基于主键的单向一对一关联映射 单 ...
- 配置zabbix agent向多个server发送数据
1.背景: agent 端:dba-test-hzj02 172.16.59.197 server端:172.16.59.197 ,172.16.59.98 2.方式: 配置多个server,se ...
- HDU1285 确定比赛名次
有N个比赛队(<=N<=),编号依次为1,,,....,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结 ...
- sqlserver游标使用和循环
/*** 游标的使用 讲了这个多游标的优点,现在我们就亲自来揭开游标的神秘的面纱. 使用游标的顺序: 声名游标.打开游标.读取数据.关闭游标.删除游标. 1.3.1声明游标 最简单游标声明:DECLA ...
- Qt+VS2015应用程序发布
本文以Qt 5.9.1+VS2015编译环境为例介绍应用程序发布流程,也适用于Qt+mingw的情况. 1. Qt依赖库 将需要发布的exe(如test.exe),放到单独的目录. 在"开始 ...
- Admob - Google广告接入
前言 现在免费小游戏及应用的主要收入渠道就是通过接入广告.而Google的Admob适用于全球范围内的广告接入,文档方面及后台管理也是较为完善,接入还是比较便捷的. 不过Google目前还在墙外,虽然 ...
- 谦先生的bug日志之hive启动权限问题
上海尚学堂谦先生的bug日志之hive启动权限问题 这几天开始做新老集群的迁移,今天开始对hive的所有数据进行迁移,主要是表的元信息和表数据.表的元信息我们存在mysql中,跟hive的服务器并不在 ...
- 【原创】修复ios输入框获取焦点时不支持fixed的bug
前些日子,做了一个手机站的项目,有一个页面是这样的, 有一个固定(position:fixed)的头部和底部导航,中间是一些表单内容,没啥特别的.但是到了ios中,正常滚动页面没有问题,一旦触发了文本 ...
- 程序员节应该写博客之.NET下使用HTTP请求的正确姿势
程序员节应该写博客之.NET下使用HTTP请求的正确姿势 一.前言 去年9月份的时候我看到过外国朋友关于.NET Framework下HttpClient缺陷的分析后对HttpClient有了一定的了 ...