Docker is a open source container program that performs operating-system-level virtualization. Docker currently provides three products
Community Edition(CE) and
Cloud. This article documents how to install and configure Docker CE in GNU/Linux, then implement the entire process through Shell script.
Relevant official site of Docker
Official tutorials of Docker
If you wanna learn more, please read its official document site.
Docker uses a client-server architecture. The Docker client talks to the Docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers. Both the Docker client and the daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon. The Docker client and daemon communicate via sockets or through a RESTful API. — Understand the architecture
More info about Docker, please read Docker overview
VS Virtual Machine
Docker Container is a methos of virtualization, but it is different from
virtual machine, such as Vagrant.
Each virtual machine includes the application, the necessary binaries and libraries and an entire guest operating system - all of which may be tens of GBs in size.
Containers include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. They’re also not tied to any specific infrastructure – Docker containers run on any computer, on any infrastructure and in any cloud.
The following pictures are from What is a Container?.
Containers and Virtual Machines Together
- OS must be 64-bit；
- Linux kernel version at least 3.10；
iptablesversion at least 1.4；
More details in Install Docker CE from binaries。
The following can be used to check if the running system is 64-bit (
- Docker Enterprise Edition (Docker EE)
- Docker Community Edition (Docker CE)
- Stable (release per quarter)
- Edge (release per month)
- Docker Cloud
Docker CE and
Docker EE supper different distributions.
|Platform||Docker EE||Docker CE|
See also Docker Cloud for setup instructions for
SoftLink, or Bring Your Own Cloud.
SLES, it can only install
Docker EE which needs to register Docker Store first.
This document is focus on
Docker CE which is just support
Complete distro release version which are supported by
|Debian||Buster 10 (Docker CE 17.11 Edge only)|
|Ubuntu||Artful 17.10 (Docker CE 17.11 Edge and higher only)|
yum install docker-ce提示的GPG信息
The difference between Ubuntu and Debian
- different package dependencies
- different distribution name, codename
Start Docker Daemon
Start docker service
Manage Docker As A Non-root User
The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user
rootand other users can only access it using
sudo. The docker daemon always runs as the
If you don’t want to use
sudowhen you use the docker command, create a Unix group called
dockerand add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the
dockergroup grants privileges equivalent to the
rootuser. For details on how this impacts security in your system, see Docker Daemon Attack Surface.
Docker Daemon Attack Surface > * only trusted users should be allowed to control your Docker daemon * if you run Docker on a server, it is recommended to run exclusively Docker on the server, and move all other services within containers controlled by Docker.
Access Remote API Through A Firewall
If you run a firewall on the same host as you run Docker and you want to access the Docker Remote API from another host and remote access is enabled, you need to configure your firewall to allow incoming connections on the Docker port, which defaults to
2376if TLS encrypted transport is enabled or
Shell script is hosted on GitLab, usage info
image has dependent child images
Fail to use command
docker rmi to remove image whose tag name is
Error response from daemon: conflict: unable to delete 978d85d02b87 (cannot be forced) - image has dependent child images
Solving it via deleting file begins with
- 2016.04.04 11:30 Thu Asia/Beijing
- 2017.03.02 15:44 Thu Asia/Shanghai
- 2017.03.03 16:49 Fri Asia/Shanghai
- 2017.04.07 09:50 Fri Asia/Shanghai
image has dependent child images
- 2017.09.08 08:31 Fri Asia/Shanghai
- 2018.04.11 11:41 Wed America/Boston