List local images
docker imagesHigh-frequency commands for images, containers, Compose, networks and volumes, with run examples and cleanup warnings.
List local images
docker imagesPull a pinned image tag; avoid latest in production
docker pull nginx:1.25Build an image from the Dockerfile in the current directory
docker build -t app:1.0 .Remove a local image
docker rmi app:1.0Save an image to a file for offline environments
docker save -o app.tar app:1.0Load an image from a file
docker load -i app.tarRemove dangling images; -a deletes all unused images
docker image pruneList all containers, including stopped ones
docker ps -aRun detached with port mapping, read-only volume and restart policy
docker run -d --name web -p 8080:80 -v /data/html:/usr/share/nginx/html:ro --restart unless-stopped nginx:1.25Open a shell in a running container; use sh on slim images
docker exec -it web /bin/bashFollow the last 100 log lines of a container
docker logs -f --tail 100 webStop and start a container
docker stop web && docker start webShow full container config including IP, mounts and networks
docker inspect webShow container CPU, memory and network usage
docker stats --no-streamCopy files between host and container
docker cp ./app.conf web:/etc/nginx/conf.d/Force-remove a container; unpersisted data inside is lost
docker rm -f webStart all services from compose.yaml in the background
docker compose up -dShow container status for the project
docker compose psFollow logs of a specific service
docker compose logs -f apiRun a command inside a service container
docker compose exec api shPull the latest images used by services
docker compose pullStop and remove containers and networks; -v also removes volumes
docker compose downList container networks
docker network lsCreate a user-defined network for service-name resolution
docker network create app-netInspect containers and IPs attached to a network
docker network inspect app-netList volumes
docker volume lsShow the host path of a volume
docker volume inspect app-dataShow disk usage of images, containers and volumes
docker system dfRemove stopped containers, dangling images and unused networks
docker system pruneAlso delete unused images and volumes; data loss is possible
docker system prune -a --volumesRemove only stopped containers
docker container pruneThis website uses cookies to ensure you get the best experience on our website. Privacy Policy.