Docker Getting Started

1 Introduction

Docker is an application engine open source container; container is a lightweight technology;
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 ;
operation of this image is called a container, the container starts very fast.

 

 

 

 

 

 

2, the core concept    ( architecture core idea, if it can not be resolved in the add a layer, docker equivalent to the operating system's operating system )
Docker host (Host): install the machine Docker program (Docker mounted directly on top of the operating system);

docker client (Client): docker host connection operation;

docker warehouse (Registry): used to store a variety of packaged software mirroring;
docker mirror (Images): packaged software image; docker in the warehouse;

docker container (Container): Examples of the image starts is called a container; container is a stand-alone application or a group of

Analogy with the idea of ​​speaking the words (QQ (which belongs to a docker mirror), window (equivalent docker host) D disk (equivalent docker warehouse), boarded qq program (docker container))

 

 

To use the Docker:
1), the installation Docker

2), to find the warehouse Docker image corresponding to the software;
3), using Docker run this image, this image will generate a Docker containers;

4) Start to stop the vessel is to start the software stops;

3, installation Docker

 

 Xshell connect with their cloud server, I used here is centos7, no download virtual machine environment to install the operating system described here do not do much.

1, check the kernel version must be 3.10 or more and -R & lt the uname 
2, install the install yum Docker Docker
. 3, the input y to confirm installation
4, starting docker [root @ localhost ~] # systemctl start docker [root @ localhost ~] # docker - Docker Version 1.12.6 V, Build 3e8e77d / 1.12.6
. 5, boot Docker [the root @ localhost ~] # systemctl Docker enable
the Created from the symlink to /etc/systemd/system/multi-user.target.wants/docker.service /usr/lib/systemd/system/docker.service. # represents the completion of startup
6, stop docker systemctl stop docker

4, Docker common operation command &

 

(1) Mirror operation

 

    http://hub.docker.com/

   (2), container operations (Note points: the operating system must be mapped to port docker container port, the firewall must be open)

1, the search image [the root @ localhost ~] Search # Docker Tomcat 
2, the mirror pulling [the root @ localhost ~] # Docker pull Tomcat 
. 3, the mirror starting container according RUN --name mytomcat -d Tomcat Docker: Latest 
. 4, PS Docker Check the operation of the container 
5, id stop the operation of the container docker stop container 
6, to see all of the containers PS -a Docker 
7, start the container docker start container id 
8, to delete a container docker rm container id 
9, made a start tomcat port mapping [root @ localhost ~] # docker run -d -p 8888: 8080 tomcat -d: background -p: a host port of the host port mapping to the container port: the port inside of the container    
10, to demonstrate the simply closed linux firewall service firewalld status; see firewall status 
service firewalld stop: turn off the firewall 11, to view the container log docker logs container-name / container-   id
more commands Referring https://docs.docker.com/engine/ reference / commandline / docker / read the image of each document

 

Guess you like

Origin www.cnblogs.com/420ITboy/p/12560096.html