What are the commonly used commands for docker?

下次还敢
Release: 2024-04-07 18:30:25
Original
590 people have browsed it

Docker common commands include commands for creating and managing containers (docker run, start, stop, restart, rm), commands for managing images (docker build, push, pull, rmi), Commands for viewing and diagnosis (docker ps, logs, top, exec, inspect), and commands for network management (docker network create, connect, disconnect), etc.

What are the commonly used commands for docker?

Docker Common Commands

Docker is a lightweight containerization platform for packaging and distributing applications program. In order to use Docker effectively, it is important to understand its common commands.

Create and manage containers

  • docker run: Create and run a container.
  • docker start: Start a stopped container.
  • docker stop: Stop a running container.
  • docker restart: Restart a container.
  • docker rm: Delete a container.

Manage images

  • docker build: Build an image from a Dockerfile.
  • docker push: Push the image to the Docker image warehouse.
  • docker pull: Pull the image from the Docker image warehouse.
  • docker rmi: Delete an image.

View and Diagnose

  • docker ps: List running containers.
  • docker logs: View the container’s logs.
  • docker top: View the processes running in the container.
  • docker exec: Execute commands in the container.
  • docker inspect: View the detailed configuration of the container.

Network management

  • docker network create: Create a network.
  • docker network connect: Connect the container to the network.
  • docker network disconnect: Disconnect the container from the network.

Others

  • docker version: Check the Docker version.
  • docker info: View Docker host information.
  • docker help: Get help for the command.

The above is the detailed content of What are the commonly used commands for docker?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template