docker 2

Posted resibe-3

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker 2相关的知识,希望对你有一定的参考价值。

 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的主要内容,如果未能解决你的问题,请参考以下文章

Docker - 为啥这个 express.js 容器带有暴露/发布的端口拒绝连接? (使用 boot2docker)

boot2docker / docker-machine / Docker Toolbox 上的 Docker 守护进程配置文件

在 boot2docker 中的 docker 中运行 kafka 时使用 JMX 进行 kafka 监控

sh docker-compose-boot2docker.sh

使用docker-machine 创建virtualbox虚拟机时指定boot2docker.iso位置和设置docker镜像加速的命令

docker系列2docker 的前世今生