top 10 docker commands
Here are ten essential Docker commands that are frequently used for managing containers and images:
-
docker run: Start a new container from a Docker image.
docker run <image_name>
-
docker ps: List running containers.
docker ps
-
docker images: List local Docker images.
docker images
-
docker pull: Download a Docker image from a registry.
docker pull <image_name>
-
docker stop: Stop a running container.
docker stop <container_id>
-
docker start: Start a stopped container.
docker start <container_id>
-
docker restart: Restart a running or stopped container.
docker restart <container_id>
-
docker exec: Run a command inside a running container.
docker exec -it <container_id> <command>
-
docker rm: Remove one or more stopped containers.
docker rm <container_id>
-
docker rmi: Remove one or more Docker images.
docker rmi <image_name>
Published on: Jul 01, 2024, 08:11 AM