docker 2

 Docker

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

 docker 2

 

There are Docker Engine, Docker client.

 

https://*.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.

 docker 2   docker 2

 

 

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

 

docker 2

 

 

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

 

上一篇:linux – 为什么我的udev规则不能在正在运行的docker容器中运行?


下一篇:Matlab 中实用数据结构之 containers.Map