CLI Flashcards
How to list running containers?
With command docker ps
How to list all containers (running and stopped)?
With command docker ps -a
How to build a Docker image from a Dockerfile?
With command docker build -t image_name .
How to run a Docker container?
With command docker run container_name
How to run a Docker container in the background?
With command docker run -d container_name
How to stop a running Docker container?
With command docker stop container_id
How to start a stopped Docker container?
With command docker start container_id
How to remove a Docker container?
With command docker rm container_id
How to force remove a Docker container?
With command docker rm -f container_id
How to remove a Docker image?
With command docker rmi image_id
How to list all Docker images?
With command docker images
How to pull an image from Docker Hub?
With command docker pull image_name
How to push an image to Docker Hub?
With command docker push image_name
How to tag a Docker image?
With command docker tag source_image target_image
How to execute a command in a running container?
With command docker exec container_id command
How to view logs of a Docker container?
With command docker logs container_id
How to inspect details of a Docker container?
With command docker inspect container_id
How to check the resource usage of Docker containers?
With command docker stats
How to list Docker networks?
With command docker network ls
How to create a Docker network?
With command docker network create network_name
How to connect a container to a network?
With command docker network connect network_name container_id
How to disconnect a container from a network?
With command docker network disconnect network_name container_id
How to list Docker volumes?
With command docker volume ls