What is "Docker" Docker? How to install? How to use it?

Source: Internet
Author: User

Learn about Docker from today, and record it through the collection and learning of online materials.

What is it?

Docker is a VMS-like, ultra-lightweight virtual machine based on the LXC implementation.

It differs from VMS in that VMS provide a complete operating system virtual environment, from the hardware level, contains a lot of similar hardware drivers, virtual processors, network interfaces and so on not needed information, and the virtual machine also needs to be relatively long-time startup, but also consumes a lot of memory, CPU resources.

Docker extends the Linux container (Linux Containers), or LXC, provides a lightweight virtual environment for processes by a high-level API. Docker leverages LXC, Cgroups, and Linux's own kernel. Unlike traditional virtual machines, a Docker container does not contain a single operating system, but is run based on the functionality provided by the operating system in an existing infrastructure.

  

Docker works like a portable container engine. It packs the application and all of its dependencies into a virtual container that can run on any Linux server.

And Docker does not include the operating system kernel as the normal virtual machine, and does not need virtual hardware platform, it directly through the Docker engine scheduling on the host platform, which greatly reduces the complexity of the call, reducing the time to run.

Docker consists of the following:
1. Docker Server Daemon (server daemon), used to manage all containers.
2. Docker command-line client for controlling the server daemon.
3. Docker Image: Find and browse Docker container images.

Benefits of Docker:

1. Start the speed block, usually 1 seconds to start.

2. High utilization of resources, the unit host can run at the same time more containers.

3. Performance overhead is minimal.

Docker's flaws:

1. Docker is Linux 64bit-based and cannot be used in Windows/unix or 32bit Linux environments

2. LXC is based on Linux kernel features such as Cgroup, so the guest system for container can only be a Linux base

3. Isolation compared to virtualization scenarios such as KVM, there are some deficiencies, all container common part of the runtime

4. Network management is relatively simple, mainly based on namespace isolation

5. Cgroup CPUs and Cpuset provide CPU functionality that is difficult to measure compared to KVM-based virtualization schemes (so DotCloud is mostly memory-charged)

6. Docker management of disk is relatively limited

7. Container is destroyed as the user process stops, and user data such as log in container is not collected

How does it fit?

On the installation of a new thing, the most reliable or official documents.

In the official case of Ubuntu, my system is Debian and the installation method is roughly the same.

1. Update Source:

sudo apt-get update

2. Add Docker repository to your local keystore:

sudo apt-key adv--keyserver keyserver.ubuntu.com--recv-keys 36a1d7869245c8950f966e92d8576a8ba88d21e9

3. Add Docker to your apt software installation Source:

sudo sh-c "Echo Deb Http://get.docker.io/ubuntu docker main/etc/apt/sources.list.d/docker.list"

4. Update:

sudo apt-get update

5. Installing Docker:

sudo apt-get install Lxc-docker

After the installation is complete, the output Docker test will appear if the installation succeeds:

Indicates that the installation was successful.

The official also provides a simple script to help you install Docker, just run this command:

Curl-s https://get.docker.io/ubuntu/| sudo sh

Everything was done in a methodical manner.

How to use it?

Now let's try running a Hello world!

First get an Ubuntu image:

sudo docker pull Ubuntu

If you feel slow, you can download it from the national mirror from the same site as the Docker website:

Docker Pull Docker.cn/docker/ubuntu

When you are finished downloading:

  

Run:

[Email protected]:~# Docker Run Docker.cn/docker/ubuntu/bin/echo xxxxx

Effect:

  

This is the simplest example, more applications, and slowly exploring!

What is "Docker" Docker? How to install? How to use it?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.