The Docker command uses a detailed

Source: Internet
Author: User
Tags docker ps docker hub docker registry

Where the <> parameters are required,

[] Enclosed as optional

Docker version View the release number of Docker, including client, server, dependent go, etc.

Docker Info View System (Docker) level information, including managed images, containers number, etc.

Docker search <image> searching for image in Docker index

Docker pull <image> drop-down image from Docker Registry server

Docker push <image|repository> push an image or repository to registry

Docker Push <image|repository>:tag Ibid, specify tag

Docker inspect <image|container> view underlying information for image or container

Docker images View images list (This command does not list all images)

Docker images-a Lists all the images

Docker PS default display of container in operation

Docker Ps-l Displays the last container created, including the non-running

Docker PS-A displays all the container, including the non-running

Docker logs <container> view container logs, which are some of the output of executing commands

Docker RM <container...> Delete one or more container

Docker RMI <image...> Delete one or more image

Docker Start/stop/restart <container> Open/stop/restart container

Docker start-i <container> start a container and enter interactive mode

Docker attach <container>attach a running container

Docker run <image> <command> create container with image and execute the appropriate command, then stop

Docker run-i-T <image>/bin/bash use image to create container and enter interactive mode, the login shell is/bin/bash

Docker run-i-t-p

Docker commit <container> [Repo:tag] a container to a new image, followed by Repo:tag Optional. The name creates a new image

Docker build <path> Look for a configuration file named Dockerfile under path path, use this configuration to generate a new image

Docker Build-t Repo[:tag] Ibid, you can specify repo and optional tag

Docker Build-< <dockerfile> using the specified dockerfile configuration file, Docker gets the content stdin, using this configuration to generate a new image

Docker Port <container> <container port> See which port is mapped to the specified port on the container, and you can actually see it with Docker PS

1. Docker version

Displays the Docker version information.

2. Docker Info

Displays Docker system information, including the number of mirrors and containers.

3. Docker Search Docker search [options ' o ';] term Docker search-s Django

Search for eligible mirrors from the Docker Hub.

--automated only the image of the automated build type is listed;
--no-trunc can display the full image description;
-S 40 lists images with a collection of no less than 40.

4. Docker pull Docker pull [-a "o";] [user/"O" >]name[:tag "O"] Docker pull Laozhu/telescope:latest

Pull or update the specified image from the Docker Hub.

-A pulls all tagged images.

5. Docker login [email protected]:~# docker Login Username:username Password: * * * Email: [Email protected] Logi N Succeeded

Enter the user name, password, and mailbox registered in the Docker Hub to complete the login process.

6. Docker Logout

Log out from the specified server after running, default to the official server.

7. Docker images docker images [options ' o ';] [name]

Lists all local mirrors. Where [name] is the keyword query for the image name.

-A Lists all mirrors (with process mirrors);
-F filter image, such as:-F [' dangling=true '] only lists the image that satisfies the dangling=true condition;
--no-trunc can display the full image ID;
-Q lists only the mirror IDs.
--tree lists all the commit histories of the image in a tree structure.

8. Docker PS

Lists all the running containers.

-A lists all containers (including sleeping mirrors);
--before= "nginx" lists the container created before a container, accepting the container name and ID as parameters;
--since= "Nginx" lists the containers created after a container, accepting the container name and ID as parameters;
-F [Exited=<int>] Lists the containers that meet the exited=<int> conditions;
-l lists only the most recently created container;
--NO-TRUNC Displays the complete container ID;
-N=4 lists the 4 newly created containers;
-Q lists only the container ID;
-S displays the container size.

9. Docker RMI Docker rmi [Options "O"] <image> "O" >[image ...] Docker rmi nginx:latest postgres:late St Python:latest

Removes one or more specified mirrors from the local.

-F forcibly removes the image, even if it is being used;
--no-prune does not remove the process image of the image, which is removed by default.

Docker RM Docker rm [options ' o ';] <container> "O" >[container ...] Docker rm nginx-01 nginx-02 DB -01 db-02 sudo docker rm-l/webapp/redis

-F forcibly removes the container, even if it is running;
-L removes the network connection between the containers, not the container itself;
-V removes the space associated with the container.

Docker History Docker History "O" >[options] <image>

View the creation history of the specified image.

--no-trunc Display the complete submission record;
-Q lists only the commit record IDs.

Docker Start|stop|restart Docker start|stop "P" >|restart [Options "O";] <container> "O" >[ Container ...]

Starts, stops, and restarts one or more specified containers.

-A pending completion
-I launches a container and enters interactive mode;
-T 10 time-out (in seconds) to stop or restart the container and the system will kill the process after a timeout.

Docker kill Docker Kill "O" >[options "O";] <container> "O" >[container ...]

Kills one or more specified container processes.

-S "KILL" to customize the signal sent to the container.

Docker Events Docker events [options ' o ';] Docker events--since= "S2" > "20141020" Docker events--until = "S2" > "20120310"

Pull personal dynamics from the server to select a time interval.

Docker Save Docker save-i "Debian.tar" Docker Save > "Debian.tar"

Saves the specified image as a tar archive, and the reverse operation of Docker load. Images saved and Reloaded (saved-loaded) do not lose the commit history and layer, and can be rolled back.

-O "Debian.tar" specifies the saved image archive.

Docker load Docker load [options] Docker load < Debian.tar docker load-i "Debian.tar"

The reverse operation of Docker save is downloaded from the TAR image archive as photographed. Images saved and Reloaded (saved-loaded) do not lose the commit history and layer, and can be rolled back.

-I "Debian.tar" specifies the loaded image archive.

. Docker export Docker export <container> Docker export nginx-01 > Export.tar

Saves the specified container as a tar archive, and the reverse operation of Docker import. The container for export after import (exported-imported) will lose all commit history and cannot be rolled back.

Docker import Docker import url|-"O" >[repository[:tag "O";] cat Export.tar "P" >| Docker import-imported-nginx:latest Docker Import Http://example.com/export.tar

Create an image from an archive file (supporting remote files), and export the reverse operation to label the import image. The container for export after import (exported-imported) will lose all commit history and cannot be rolled back.

Docker top Docker top <running_container> "O" >[ps options]

View a running container process that supports PS command parameters.

Docker inspect Docker instpect nginx:latest Docker inspect Nginx-container

Check the parameters of the mirror or container and return the JSON format by default.

-f Specifies the template file for the return value.

. Docker Pause

Pauses all processes for a container.

Docker unpause Docker unpause <container>

Restores all processes of a container.

* Docker tag docker tag [options ' o ';] <image>[:tag "O";] [repository/"O" >][username/]name "O" >[:tag]

Mark the local image and place it in a warehouse.

-F overrides an existing tag.

Docker push Docker push Name[:tag "O";] Docker push Laozhu/nginx:latest

Push the image to the remote repository, which defaults to the Docker Hub.

Docker logs docker logs [options ' o ';] <container> Docker logs-f-t--tail= "S2" > "Insane_bab" Bage

Gets the output log of the container runtime.

-F keeps track of recent updates to container logs;
-T displays the timestamp of the container log;
--tail= "10" lists only the latest 10 container logs.

. Docker run Docker run [Options "O"] <image> ["NB" >command] "O" >[arg ...]

Launches a container in which to run the specified command.

-a stdin specifies the standard input and output content type, optional stdin/stdout/stderr three items;
-D background runs the container and returns the container ID;
-I runs the container in interactive mode and is usually used with-t;
-T re-allocates a pseudo-input terminal to the container, usually with-I simultaneously;
--name= "nginx-lb" specifies a name for the container;
--dns 8.8.8.8 Specifies the DNS server used by the container, default and host consistent;
--dns-search example.com Specifies the container DNS search domain name, default and host consistent;
-H "Mars" specifies the hostname of the container;
-E Username= "Ritchie" setting environment variables;
--env-file=[] read from the specified file into the environment variable;
--cpuset= "0-2" or--cpuset= "0,1,2" binds the container to the specified CPU to run;
-C Pending Completion
-M pending completion
--net= "Bridge" specifies the type of network connection for the container and supports four types of bridge/host/none container:<name|id>;
--link=[] Pending completion
--expose=[] Pending completion

Partially transferred from http://www.server110.com/docker/201411/11122.html

The Docker command uses a detailed

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.