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支持将软件编译成一个镜像:然后在镜像中各种软件做好配置,将镜像发布出去,其他使用者可以直接使用这个镜像:运行中的这个镜 ...
随机推荐
- ubuntu 添加右键打开方式,无法添加程序打开方式
最近把工作环境迁移到ubuntu,装了WPS for Linux ,说实话确实是十分良心啊!运行效率奇高,绿色无广告,并且和windows版本无异,感觉就可以抛弃自带的libreoffice了. 但是 ...
- ionic新入坑-环境搭建+新建项目+打开低版本项目处理
是的.我又双叒叕入新坑了.想我大学的时候web-app刚火起来.还帮忙做了我们学校医务室系统的web-app页面部分呢.时间太紧最后也没出个完整的版本.那时候只是用H5简单做了web部分.是想着用ph ...
- Python系列之 - 面向对象(2)
类的三大特性 类的三大特性包括: 封装.继承.多态 一 封装 封装就是将类所用到的所有字段.属性.方法都包含在类代码段里面,当实例调用直接调用类中的方法即可. class People(object) ...
- Jmeter启动问题总结
下载下来的jmeter文件,双击jmeter.bat文件打开的时候,系统提示如下: 查询安装的环境,java的jdk存在,并且版本在1.7以上,详情如下: 在环境变量PATH中添加:%SystemRo ...
- [python]使用django快速生成自己的博客小站,含详细部署方法
前言 人生苦短,我用python 这是之前经常听到的一句笑谈.因为新公司很多业务是用的python语言,所以这几天也一直在学习python的一些东西. 作为一个之前一直java后端的开发人员,对比ja ...
- 【LSGDOJ 2015】数页码
题目描述 一本书的页码是从 1-n 编号的连续整数:1, 2, 3, ... , n.请你求出全部页码中所有单个数字的和,例如第 123 页,它的和就是 1+2+3=6. 输入 一行为 n(1 < ...
- linux内核中的链表
1.内核中的链表 linux内核链表与众不同,他不是把将数据结构塞入链表,而是将链表节点塞入数据,在2.1内核中引入了官方链表,从此内核中所有的链表使用都采用此链表,千万不要在重复造车轮子了!链表实现 ...
- bzoj 2440 (莫比乌斯函数)
bzoj 2440 完全平方数 题意:找出第k个不是完全平方数的正整数倍的数. 例如 4 9 16 25 36什么的 通过容斥原理,我们减去所有完全数 4有n/4个,但是36这种会被重复减去, ...
- [bzoj4821][Sdoi2017]相关分析
来自FallDream的博客,未经允许,请勿转载,谢谢. Frank对天文学非常感兴趣,他经常用望远镜看星星,同时记录下它们的信息,比如亮度.颜色等等,进而估算出星星的距离,半径等等.Frank不仅喜 ...
- python day3_liaoxuefeng
1.Python的循环有两种,一种是for...in循环,依次把list或tuple中的每个元素迭代出来,看例子: names = ['Michael', 'Bob', 'Tracy'] for na ...