Http://dockone.io/article/101
Docker Introductory Tutorial (i) Introduction to "editor's words" dockerone organization translated FLUX7 's Docker starter tutorial, this is the first of a series of introductory tutorials that describes the basic concepts of Docker and the installation of Docker.
Docker is a new containerized technology, it is lightweight and portable, known as "build once, configure once and run Anywhere" (Translator Note: This is not translated, the taste is not translated) ". This article is the first part of the FLUX7 Docker series tutorial. Learn and understand the advantages of Docker with this tutorial, and how to use it better.
Let's study Docker together.
This article focuses on the basics of Docker: Docker features, ideas, and how to install and use Docker.
Docker features Docker has a lot of interesting features that you will be able to understand better through this tutorial. The features of Docker mainly include the following points:
- Fast and elegant isolation frame
- Cheap
- cpu/low consumption of memory
- Quick turn on/off
- Cross-Cloud infrastructure
Docker components and elements Docker has three components and three basic elements, and the reader can quickly navigate through the following video to see what these builds and elements are and how they relate to each other. Each of the three components is:
Docker Client
Is the user interface, which supports Docker Daemon
communication between users.
Docker Daemon
Runs on the host and processes the service request.
Docker Index
is a central registry that supports backups of Docker container images that have public and private access rights.
The three basic elements are:
Docker Containers
Responsible for the operation of the application, including the operating system, user-added files, and meta-data.
Docker Images
is a read-only template that is used to run the Docker container.
DockerFile
is a file instruction set that describes how to create a docker image automatically.
Before discussing how Docker components interact with basic features, let's talk about the pillars of Docker. Docker uses the following operating system features to improve container technology efficiency:
Namespaces
Acts as the first level of isolation. Ensure that a process is running in one container and cannot see or affect other processes outside the container.
Control Groups
is an important part of LXC and has the key function of resource accounting and restriction.
UnionFS
(file system) as a building block of a container. To support the lightweight and fast nature of Docker, it creates a user layer.
How to put them together to run any application requires two basic steps:
- Build a mirror.
- Run the container.
These steps are all from
Docker Client
command to start.
Docker Client
You are using a Docker binary file. On a basic level,
Docker Client
'll tell
Docker Daemon
The image that needs to be created and the commands that need to be run inside the container. When the daemon receives a signal to create the image, the following actions are performed:
1th Step: Build the image as described earlier,
Docker Image
is a read-only template for a build container that contains all the information needed to start a container, including running programs and configuration data.
Each image originates from a basic image and then creates a template based on the instructions in Dockerfile. For each instruction, create a new layer on the mirror.
Once the mirrors have been created, they can be pushed to the Central registry:
Docker Index
For others to use. However
Docker Index
Provides two levels of access to mirroring: Public access and private access. You can store the images in a private warehouse, and the Docker website has a private warehouse package for you to choose from. In summary, public warehouses are searchable and reusable, and private warehouses can only be used by members with access rights.
Docker Client
can be used to
Docker Index
Within the image search.
2nd step: Running the container runs the container from the image we created in the first step. When the container is started, a read-write layer is added to the top layer of the mirror. When the appropriate network and IP addresses are assigned, the required applications can be run in the container.
If you still do not understand, do not worry, in the next content we will share with you a lot of practical cases.
So far, we've introduced the basic concept of Docker, and next, let's install docker!
Installing Docker: Quick Guide below Let's look at how to install Docker on Ubuntu 12.04 LTS (Note: The CentOS 6.5 installation can refer here):
- Check the HTTPS compatibility of the APT system. If the Usr/lib/apt/methods/https file does not exist, install the
apt-transport-https
package.
- Add the Docker repositor key locally. Repository key:hkp://keyserver.ubuntu.com:80--recv-keys 36a1d7869245c8950f966e92d8576a8ba88d21e9
- Add Docker repository to apt source list.
- Install the Lxc-docker package.
sudo apt-get update sudo apt-get install lxc-docker
- Verify the content that is installed.
sudo docker run -i -t ubuntu /bin/bash
Docker Introductory Tutorial (i) Introduction