Docker 基础
理论和实操同样重要不要浮躁!!!
Docker架构图:
Docker 三要素:镜像,容器,仓库。
镜像/容器:镜像就是一个只读的模板,Dockers利用容器(container)独立运行的一个或者一组应用,容器是用镜像创建的运行实例
Person p1= new Person();
Person p2= new Person ();
Person p2= new Person ();
镜像就是模板 是类,容器是类运行的实例
容器:
仓库:集中存放镜像文件的场所。DockerHud
Docker的安装:
1.yum install -y epel-release
2.yum install -y docker-io
3.安装后的配置文件:/ect/sysconfig/docker =>ls /etc/sysconfig/docker
4.启动Dokcer后台服务:service dockers start
5.dockers version 验证
service docker start
Dockers Hello work 运行原理:
Docker和虚拟机:
1.Docker本质上是一个采用虚拟化技术的容器,基于Linux容器进行再封装,使用户不用关心容器的管理,而简化应用操作。从2013开始有这个项目到现在也不过5年时间,但是发展应用却极其迅速,主要原因就是应用简单方便,传统的虚拟化是基于硬件实现的,如果要部署10个应用,则需要创建10个虚拟机,而Docker是基于操作系统做的虚拟化,也就是复用本地主机的操作系统,部署运营10个应用时只需要起10个隔离的应用即可。
1.Docker is essentially a container using virtualization technology. It is re-packaged based on Linux container, so users do not need to care about the management of the container, but simplify the application operation.Start with the project from 2013 to now five years, however, also use but development is very rapidly, the main reason is simple and convenient application, the traditional virtualization is based on the hardware implementation, if you want to deploy 10 application, you will need to create 10 virtual machine, and Docker is based on the operating system virtualization, also is the reuse of the local host operating system, application deployment operation 10 when you just need to up 10 isolation applications.