[Application] Docker Introduction and Installation

Docker Profile

  Docker is an open source application container engine, and follow Apache2.0 agreement based on open source Go language. Docker allows developers to package their applications and dependencies to a lightweight, portable container and then posted to any popular Linux machine, can be virtualized. The container is full use of the sandbox mechanism will not have any interface with each other, more important is the performance overhead is very low container.

  Docker support software will compile into a mirror; then do a variety of software configuration in the mirror, the mirror will release out, other users can directly use this image. This operation is called mirroring container, the container starts very fast. Similar windows inside the ghost operating system, installed have it all;

Docker core concepts

  docker mirror (Images): Docker Docker mirror is used to create a template container.

  docker container (Container): is a container or a group of applications run independently.

  docker client (Client): Client via the command line or other tools Docker API (https://docs.docker.com/reference/api/docker_remote_api) through the daemon Docker's

  docker host (Host): a physical or virtual machines for performing Docker daemon and the container.

  docker warehouse (Registry): Docker repository for holding the mirror, to be understood that the code in code control repository. Docker Hub (https://hub.docker.com) provides a huge collection of mirrors for use.

  

Docker installation

  Reference official website: https://docs.docker.com/install/linux/docker-ce/centos/

  This Example installation environment: CentOS 7.4

  1, Red Hat RHEL installation, dependency check Docker

    Docker system requires a 64-bit Red Hat system, kernel version must be greater than 3.10. You can use the following command to check meets the requirements of the docker.

    Command: uname -r

    

  2, log on CentOS root privileges. Ensure that the yum package up to date.

    Instruction: Sudo Yum Update

   3, uninstall the old version docker

    Docker older version called docker or docker-engine. If these programs are installed, uninstall them and the associated dependencies.

    命令:sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

  Docker engine installation - Community Board

    Before installing Docker Engine-Community for the first time on the new host, you need to set Docker warehouse. After that, you can install and update Docker from the repository.

  4, set up warehouses

    a) install the needed packages. Providing yum-utils yum-config-manager function, and devicemapper-persistent-data, and by the need lvm2 devicemapper storage driver.

      命令:sudo yum install -y yum-utils device-mapper-persistent-data lvm2

    b) Use the following commands to set a stable warehouse .

      Official website command: sudo yum-config-Manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

      Foreign address is connected, the connection may be slow, Ali cloud images can be used for all address

      Ali cloud images command: sudo yum-config-Manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

      

      You can use the command: CAT /etc/yum.repos.d/docker-ce.repo

  5, yum package index update

    Command: yum makecache the FAST

  6, install the latest version of Docker Engine-Community and containerd

    命令:yum install docker-ce docker-ce-cli containerd.io

    You can also specify the version installed

      a) view the version command: yum List Docker-ce --showduplicates | the Sort -r

      b)安装命令:sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

  7, start Docker service

    Command to start the service: systemctl Start Docker

    Stop service command: systemctl STOP Docker

    Check the running status command: systemctl Status Docker

    Restart service command: systemctl restart Docker

    Boot command: systemctl enable Docker

    Boot does not start command: systemctl disable Docker

    Check the power status command: systemctl IS-Enabled Docker

  8, a test to verify correct installation of Docker Engine-Community 

    a) Check version

      Command: Docker Version

        

    b) run to verify the hello-world images

      命令:sudo docker run hello-world

      Results are as follows:

        

 

Guess you like

Origin www.cnblogs.com/h--d/p/12538584.html