概述
Docker Engine
-
a daemon process (the
dockerd
command) -
A REST API
-
A command line interface (CLI) client (the
docker
command).
The daemon creates and manages Docker objects, such as images, containers, networks, and volumes.
What can I use Docker for?
-
Fast, consistent delivery of your applications
-
Responsive deployment and scaling
-
Running more workloads on the same hardware
Docker Architecture
Docker objects
-
image
-
container
-
network
-
volume
-
plugin
-
other objects
Example
docker run -i -t ubuntu /bin/bash
-
Docker pulls the
ubuntu
image from your configured registry,docker pull ubuntu
; -
Docker creates a new container,
docker container create
; -
Docker allocates a read-write filesystem to the container, as its final layer.
-
Docker creates a network interface to connect the container to the default network
-
Docker starts the container and executes
/bin/bash
. -
type
exit
to terminate the/bin/bash
command, the container stops but is not removed.
The underlying technology
Namespaces
Docker uses a technology called namespaces
to provide the isolated workspace called the container.
-
The
pid
namespace: Process isolation (PID: Process ID). -
The
net
namespace: Managing network interfaces (NET: Networking). -
The
ipc
namespace: Managing access to IPC resources (IPC: InterProcess Communication). -
The
mnt
namespace: Managing filesystem mount points (MNT: Mount). -
The
uts
namespace: Isolating kernel and version identifiers. (UTS: Unix Timesharing System).