Docker学习笔记1:CentOS7 下安装Docker
本文内容摘自官网:https://docs.docker.com/engine/installation/linux/centos/#/create-a-docker-group
注:本文是介绍Linux 上的分布式版本CentOs上安装.
一、安装前的准备工作
[root@localhost ~]# uname -r
3.10.0-327.el7.x86_64
最后,建议你全面更新你的系统. 请记住,你已经完全修复任何潜在的内核bug.
二、安装Docker
[root@localhost ~]# sudo yum update
3、加入yum repo
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
4、安装Docker包
$ sudo yum install docker-engine
5、启动Docker守护进程
$ sudo service docker start
6、通过运行容器中的一个测试image,来验证你的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/
至此,Docker就已安装好了.
三、自动启动Docker
[root@localhost ~]# sudo chkconfig docker on
Note: Forwarding request to 'systemctl enable docker.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
四、Docker 卸载
[root@localhost ~]# yum list installed | grep docker
docker-engine.x86_64 1.12.1-1.el7.centos @dockerrepo
docker-engine-selinux.noarch 1.12.1-1.el7.centos @dockerrepo
2 、移除这个package
$ sudo yum -y remove docker-engine.x86_64
这个命令没有移除images、containers、volumes或者你主机上用户创建的配置文件.
[root@localhost ~]# ll /var/lib/docker/
total 4
drwx------. 5 root root 4096 8月 23 10:03 containers
drwx------. 5 root root 50 8月 23 09:30 devicemapper
drwx------. 3 root root 25 8月 23 09:30 image
drwxr-x---. 3 root root 18 8月 23 09:30 network
drwx------. 2 root root 6 8月 23 09:30 swarm
drwx------. 2 root root 6 8月 23 09:30 tmp
drwx------. 2 root root 6 8月 23 09:30 trust
drwx------. 2 root root 24 8月 23 09:30 volumes
$ rm -rf /var/lib/docker
4、查找和删除任何用户创建的配置文件.
Docker学习笔记1:CentOS7 下安装Docker的更多相关文章
- 学习笔记(1)centos7 下安装nginx
学习笔记(1)centos7 下安装nginx 这里我是通过来自nginx.org的nginx软件包进行安装的. 1.首先为centos设置添加nginx的yum存储库 1.通过vi命令创建一个rep ...
- docker学习之路-centos下安装docker
前言 我要在云服务器上做一个asp.net core的webapi应用,使用docker来部署应用,中间用到的任何组件包括nginx和sqlserver 2017都是用docker来装载运行,所以,这 ...
- 学习笔记(3)centos7 下安装RabbitMQ
centos7 安装RabbitMQ 安装erlang 因为RabbitMQ由ERLANG实现,所以需要先安装erlang.可以从https://www.erlang-solutions.com/re ...
- 学习笔记(2)centos7 下安装mysql
centos7安装mysql 本文通过yum方式安装mysql 1.添加mysql yum 仓库 去mysql开发者中心(http://dev.mysql.com/downloads/repo/yum ...
- centos7下安装docker与镜像加速
1.背景 centos7下安装docker 2.安装 第一步:检查是否为centos7版本 第二步:依赖环境安装 执行如下两个命令: yum -y install gcc yum -y install ...
- docker(一) Centos7下安装docker
docker(一) Centos7下安装dockerdocker(二) windows10下安装dockerdocker(三) 镜像和容器常用命令 docker(四) 使用Dockerfile构建镜像 ...
- CentOS7下安装docker(Docker系列1)
CentOS7下安装docker 系统要求 为了安装docker,需要准备 64-bit的CentOS 7 删除非官方的Docker包 yum的仓库中有一个很旧的Docker包, 现在Docker官方 ...
- centos7 下安装docker报错:You could try using...
搞了台VPS,想要装docker,发现死活装不上,各种报错.之前系统是centos6,发现官方现在已经不支持centos6了,遂升级到centos7,然后还是出现下面这个错误. Error: Pack ...
- Centos7 下安装 Docker
一.简介 Docker是一个开源的应用容器引擎:是一个轻量级容器技术:Docker支持将软件编译成一个镜像:然后在镜像中各种软件做好配置,将镜像发布出去,其他使用者可以直接使用这个镜像:运行中的这个镜 ...
随机推荐
- 在MySQL中使用子查询
子查询作为数据源 子查询生成的结果集包含行.列数据,因而非常适合将它与表一起包含在from子句的子查询里.例: SELECT d.dept_id, d.name, e_cnt.how_many num ...
- WPF中自定义GridLengthAnimation
需求 我们想在编辑一个列表中某一个条目时,将编辑的详情内容也放置当前面,比如右侧. 可以通过将一个Grid,分成两个Cloumn,动态调整两个Cloumn的Width,就可以实现这个需求. 我们知道, ...
- Windows下Java开发环境安装与配置
1. 前往Oracle网站下载JDK程序并安装. http://www.oracle.com/technetwork/java/javase/downloads/index.html 目前最新的版本为 ...
- [LeetCode] Array Partition I 数组分割之一
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1 ...
- Angular1.x使用小结
之前工作以Angular1.x为主,主要做业务系统,以后工作中技术栈可能以vue为主,在此对Angular1.x的使用做一个简单总结,这里使用1.5+版本. 基本概念 1.依赖注入 依赖注入,在ang ...
- java处理大文本方案
转载自:http://langgufu.iteye.com/blog/2107023 java处理大文件,一般用BufferedReader,BufferedInputStream这类带缓冲的Io类, ...
- git中的merge与rebase
之前一直对git的merge与rebase很困惑,而且一般也只使用merge而不是使用rebase.今天受高人指点理清了两者的区别. 首先对于两者而言,他们的结果是一样的,差异在于合并的方式(产生的结 ...
- 学习flexible.js
flexible是手淘团队总结的一套移动端适配方案,这篇文章是自己对flexible学习历程的记录,也算是一个备忘. https://github.com/amfe/article/issues/17 ...
- [HAOI2012]道路
题目描述 C国有n座城市,城市之间通过m条[b]单向[/b]道路连接.一条路径被称为最短路,当且仅当不存在从 它的起点到终点的另外一条路径总长度比它小.两条最短路不同,当且仅当它们包含的道路序列不同. ...
- GotoAndPlay
10月3日,在杭州市西湖景区,一只小松鼠不停地接受一道道食物,花生.玉米.饼干,可谓来者不拒,憨态可掬的模样吸引了众多围观者...Description 小松鼠终于吃撑了,她决定逃离这个地方. 我 ...