码迷,mamicode.com
首页 > 其他好文 > 详细

docker 2

时间:2019-05-17 13:51:34      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:run   manager   creat   nts   func   dev   containe   style   util   

 Docker

The Docker itself is a software container platform which allows us to create and manage containers.

 技术图片

 

There are Docker Engine, Docker client.

 

https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine

http://artemstar.com/2017/07/23/docker-os-images

https://www.silicon.co.uk/software/open-source/linux-kernel-cgroups-namespaces-containers-186240?inf_by=59f18086681db813098b456c

 

Why needs virtualization

-        running multiple instances of an application or running different versions of the same application at the same time. For example, running multiple instances of nginx would require changing its init script, as well as its configs because we can’t bind more than one application to the same port.

-        Running several OS

-        Python has provided a module to create its virtual environment (path of package or runtime lib)

 

Virtual Machine

VM hey are often used in cases when we need to provide computing resources to different people. Virtual machines allows us to allocate the exact number of computing resources to meet the client’s requirements, and if there’s some resources left we can allocate it to another client.

 技术图片   技术图片

 

 

Hypervisor: translate guest OS kernel code to software instructions

Hypervisor abstracts the underlying hardware (virtualizes it) to provide the same hardware to several operating systems

 

技术图片

 

 

Containers are an abstraction at the OS layer.

Linux container:

Under the hood, Docker is built on the components:

cgroups and namespaces capabilities of the Linux kernel

-        cgroups, which stands for control groups, are a kernel mechanism for limiting and measuring the total resources used by a group of processes running on a system

-        Namespaces are a kernel mechanism for limiting the visibility that a group of processes has of the rest of a system

So a docker image doesn’t need to contain a OS image, all it needs is a bundle of dependencies of target.

Create base image: https://docs.docker.com/develop/develop-images/baseimages/

But usually, we will create image based on an OS image, like Ubuntu

-        ubuntu container images is stripped down image of a real operating system which doesn’t include kernel, but does have some libs and utilities specific to Ubuntu distro.

-        it facilitates troubleshooting. For instance, OS image may have a shell installed

-        this is a package manager

 

windows container

https://xebia.com/blog/deep-dive-into-windows-server-containers-and-docker-part-2-underlying-implementation-of-windows-server-containers/

With the introduction of Windows Server 2016 Technical Preview 3 in August 2015, Microsoft enabled the container technology on the Windows platform

the Kernel Mode of an operating system has been implemented for drivers that need to have unrestricted access to the underlying hardware.

In the User Mode, the code always runs in a separate process (user space),

Linux exposes its kernel level functionalities via syscalls, Microsoft decided to control their kernel mode outbound functionalities via DLL’s

In Windows containers you’ll see a bunch of extra System Processes running while Linux containers only have to run the specified Application Processes

 

docker 2

标签:run   manager   creat   nts   func   dev   containe   style   util   

原文地址:https://www.cnblogs.com/resibe-3/p/10880665.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!