Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of commonly used docker commands

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "commonly used docker command summary". In daily operation, I believe many people have doubts about the commonly used docker command summary problems. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "commonly used docker command summary"! Next, please follow the editor to study!

Use of the docker command

Summarize the common commands:

The widened parameters are required, and [] widened are optional.

Docker version checks the version number of docker, including client, server, dependent Go, etc.

Docker info views system (docker) level information, including managed images, number of containers, etc.

Docker search searches docker index for image

Docker pull pulls down image from docker registry server

Docker push pushes an image or repository to registry

Docker push: TAG is the same as above, specify tag

Docker inspect views the underlying information of image or container

Docker images TODO filter out the intermediate image layers (what is intermediate image layers)

Docker images-a lists all images

Docker ps displays running container by default

Docker ps-l displays the last created container, including those that are not running

Docker ps-a displays all container, including those that are not running

Docker logs looks at the log of container, that is, some output from executing the command

Docker rm deletes one or more container

Docker rm `docker ps-a-q` Delete all container

Docker ps-a-Q | xargs docker rm as above, delete all container

Docker rmi deletes one or more image

Docker start/stop/restart start / stop / restart container

Docker start-I starts a container and enters interactive mode

Docker attach attach A running container

Docker run uses image to create the container and execute the appropriate command, and then stop

Docker run-I-t / bin/bash uses image to create container and enter interactive mode, login shell is / bin/bash

Docker run-I-t-p maps the port of container to the port of host

Docker commit [repo:tag] solidifies a container into a new image, followed by an optional repo:tag

Docker build looks for a configuration file named Dockerfile under the path path, and uses this configuration to generate a new image

Docker build-t repo [: tag] same as above, you can specify repo and optional tag

Docker build-< uses the specified dockerfile configuration file, docker gets the content in stdin mode, and uses this configuration to generate a new image

Docker port checks which local port is mapped to the designated port of container. In fact, you can also see it with docker ps.

At this point, the study of "summary of commonly used docker commands" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report