Docker common commands (continuous update)


1. Docker command

Docker Version (get docker version number)

Docker login (log in to docker and fill in the account and password of according to the prompts)

2. Mirror operation command

Docker search tutorial (find the docker image, tutorial is the image name)

Docker pull learn / Turbo (download the image, and learn / turbo is the image name)

Docker commit 72d0ff864e05 jie3306 / Ping (generate image, 72d0ff864e05: container ID, jie3306 / Ping: image name)

Docker push jie3306 / Ping (push image to docker warehouse, jie3306 / Ping: image name (docker login is required before pushing))

3. Container operation command

Docker run learn / tutorial echo "Hello world" (generate container, learn / tutorial: image name, echo "Hello world": shell executed by container)

Docker PS - L (container list, - L: command parameters)

Docker inspect 5070 (see container details, 5070: the first few characters of container ID (only the first few digits of container Id need to be filled in))

Docker start 96b64da0c203

Docker stop 96b64da0c203

Docker logs 96b64da0c203

Docker stats 96b64da0c203 (view the system resources occupied by the container)

Docker exec mywordpress PS - ef (execute command inside the container, mywordpress: container name, PS - EF: shell command)

Docker exec - it mywordpress / bin / bash (enter the container, mywordpress: container name)

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Programming Xiaobai must understand the network principle

How is the network composed? Why can we easily surf the Internet now?Whether you are a computer major or not, you may always have such questions in your heart!And today we will solve this matter and tell you the real answer! Basic composition of network First, let’s look at this sentence Connect all computers together […]