Recently, the stable version of docker1.0 is released, which injects fresh blood into Paas.
Docker is a powerful automated Distributed System: large-scale Web deployment, database clusters, continuous deployment systems, private paas, and service-oriented architecture.
Docker is a Linux XC iner (lxc) technology that adds advanced APIs and provides a lightweight virtualization solution that can run Unix processes independently.
It provides a way to automatically deploy software in a secure and reusable environment.
Cantgis will explain how docker runs on centos.
The cantgis experimental environment is run in centos7:
1. All docker operations require the root permission and sudo:
docker search centos
2. Download the service image and select the tag.
docker pull centos:centos7
3. view the downloaded Image
docker images
4. Create a container Based on the downloaded Image
docker run -i -t centos:centos7 /bin/bash
Then you enter a container, a new centos7 system encapsulated, and exit the container.
5. view all container
docker ps -a
6. If you download the corresponding image from a private or public docker database, use the build parameter. The parameter [.] is the configuration file. Click,Dockerfile
docker build -t NEW_Images .
7. Build the container according to dockerfile in the current directory [this command applies to creating httpd or nginx services in a container, and publish the ing ports under-P.]
docker run -i -t - p 2013:80
Run a container. The following parameters are supported:
-d
Detached or daemon mode, which runs in the background.
-i -t
Open a putty terminal to maintain the interactive mode. These two terminals are generally used together.
-e
To set environment variable parameters, see install gitlab with docker
-p [host_port]:[container_port]
Maps host ports to containers to facilitate external access to services in containers. host_port can be omitted.
-v [host-path]:[container-path]
Mount the host folder to the iner to save data.
--rm
Automatically delete a container with the same image already running.
8. List the currently running containers,-a
Will list all, including stopped,-q
Only list container IDs.
docker ps -a -q | xargs docker rm
This can delete all containers that are not running.
10. Delete the specified iner.
docker rm ContainerID
11. Delete the specified Images
docker rmi imagesID
For more information, see the docker documentation.
The figure below is a very good explanation. Let's take a look at it.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/45/D7/wKiom1PsZAGC6gmRAAKyXSfmYaE819.jpg "Title =" clipboard.png "alt =" wkiom1pszagc6gmraakyxsfmyae819.jpg "/>
This article is from the "cantgis" blog, please be sure to keep this source http://cantgis.blog.51cto.com/5788192/1539964