Docker-1. Related knowledge + installation + Mirroring related operations

Source: Internet
Author: User


Related knowledge
It is a lightweight virtualization technology that, compared to traditional virtualization, has a fast start-up speed, low resource requirements, high performance, and a single machine can support thousands of containers.

Image (Image)
Similar to virtual machine mirroring, it can be understood as a read-only template for the Docker engine that contains the file system. It is the basis for creating containers

Container (Container)
Like a lightweight sandbox, Docker uses containers to run and isolate applications.
A container is an instance of an application created from a mirror that can be started, started, stopped, deleted, and these containers are isolated from each other and are not visible. It itself is read-only. When the container starts from mirroring, Docker creates a writable layer on top of the mirror, and the image itself remains intact.

Warehouse (Repository)
Place where the image files are stored

1: Installation
Docker support for use on mainstream operating system platforms, including Ubuntu CentOs windows and Mac

Ubuntu 14.04 or later installs Docker
Apt-get Install Apt-transport-https
Apt-key adv--keyserver hkp:// 36a1d7869245c8950f966e92d8576a8ba88d21e9
Bash-c "Echo Deb Https:// Docker main >/etc/apt/sources.list.d/docker.list"
Apt-get install-y Lxc-docker

2: Mirroring about

2.1 Download Ubuntu pack
Docker pull Ubuntu

Note: The format of this command is Docker pull Name[:tag]; If you do not specify tag, the latest label is selected by default, which is to download the latest version of the image in the repository.

2.2 View Local existing mirrors
Docker images

Ubuntu 14.04 D2a0ecffe6fa hours ago 188.4 MB
Tags are: which warehouse, mirror label, image ID, creation time, image size

2.3 Add a new label to the local mirror (similar to the effect of adding a shortcut)
Docker tag ubuntu:1404 ubuntu:latest

2.4 Viewing image details
Docker Inspect

2.5 View the public warehouse image about MySQL
Docker search MySQL

MySQL MySQL is a widely used, Open-source Relati ... 822 [OK]
Mysql/mysql-server Optimized MySQL server Docker images.   Crea ... [OK]

Tags are: image name, description, star rating, whether the official creation, whether automatically created

2.6 Removing mirrors
Docker RMI ubuntu:1404

2.7 Creating a mirror based on an existing container
Docker commit-m ' Add a new file '-a ' Docker user ' a925cb40b3f0 test

-a/--author= ' Author information
-m/--message= ' Submit message
-p/--pause=true Suspend container when committing

2.8 Deposit and load photographed image
You can use the Docker save and Docker load commands to save and load photographed images.

Deposit: Docker Save-o Ubuntu_14.04.tar ubuntu:14.04
Loading: Docker load--input Ubuntu_14.04.tar
Or: Docker load < Ubuntu_14.04.tar

2.9 Uploading images
You can upload the image to the repository using the Docker Push command, which is uploaded to the Dockerhub official repository by default (login required)
Docker Push Name[:tag]

This article is from the "Zhengerniu" blog, make sure to keep this source

Docker-1. Related knowledge + installation + Mirroring related operations

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: 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.