首页 技术 正文
技术 2022年11月15日
0 收藏 780 点赞 4,677 浏览 1413 个字

已经多年不写博客, 看完《晓松奇谈》最后一期猛然觉醒, 决定仔细梳理下自己这几年的知识脉络。

既然决定写, 那么首先就从最近2年热门的开源项目Docker开始。Docker 这两年在国内很是火爆, 国内也有很多Docker的创业公司在做docker平台相关的事情。

比如已经拿到风投的Daocloud. 同时Docker也获得了很多大公司的青睐e.g. Google、Microsoft.

既然docker那么火热, 那么docker是什么呢? 我们一起看看Docker官网对docker的介绍

Docker provides a way to run applications securely isolated in a container, packaged with all its dependencies and libraries.
Because your application can always be run with the environment it expects right in the build image, testing and deployment is simpler than ever,
as your build will be fully portable and ready to run as designed in any environment.
And because containers are lightweight and run without the extra load of a hypervisor,
you can run many applications that all rely on different libraries and environments on a single kernel, each one never interfering with the other.
This allows you to get more out of your hardware by shifting the “unit of scale” for your application from a virtual or physical machine, to a container instance.

简而言之, Docker是一种轻量级的容器,通过Docker Image你可以统一客户环境和开发环境, 从而避免开发人员经常遇到的环境不一致导致的问题, 简化了测试以及部署。

同时容器使用的是宿主机的操作系统, 容器通过对“用户空间”的抽象化处理提供操作系统层级的虚拟化机制, 这也就意味着你可以单机运行大量的容器水平扩展容器。

Docker 容器和传统的VM有什么区别呢?

Docker 第一篇–初识docker

虚拟机比容器多了个一个Hypervisor层, Hypervisor 是虚拟机的核心所在。 他为虚拟机提供了虚拟的运行平台,管理了虚拟机操作系统的运行。

但是Docker容器没有这一层, Docker容器提供的是OS级别的进程隔离,这就意味着容器没有Hypervisor带来的性能损耗。

容器和宿主机共享操作系统通过cgroup来实现资源的隔离。

Docker 容器相对于VM有什么优缺点呢?

  1. Docker是开源免费的,vmvare是收费的而且死贵。
  2. Docker容器的创建是秒级的, 虚拟机通常是分钟级的。
  3. Docker容器需要的资源更少, 一台宿主机可以创建上千个application容器, 你创建上千个VM试试?
  4. 因为Docker的root用户依赖于宿主机, 所以docker的安全性更差。
  5. 因为Docker容器提供的是进程级别的隔离, 所以docker的隔离性更差。
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,942
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,468
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,281
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,096
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,728
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,765