Here is a Docker cheat sheet with some commonly used commands:
docker build
: Build an image from a Dockerfiledocker run
: Run a container from an imagedocker ps
: List running containersdocker stop
: Stop a running containerdocker rm
: Remove a stopped containerdocker images
: List all images on the systemdocker rmi
: Remove an image from the systemdocker exec
: Run a command inside a running containerdocker logs
: Show the logs of a containerdocker network
: Manage Docker networksdocker-compose
: Manage multi-container Docker applicationsdocker pull
: Download an image from a registrydocker push
: Upload an image to a registrydocker inspect
: Display low-level information about a container or imagedocker tag
: Assign a new name and tag to an imagedocker commit
: Create a new image from a container's changesdocker save
: Save one or more images to a tar archivedocker load
: Load an image from a tar archivedocker attach
: Attach local standard input, output, and error streams to a running containerdocker cp
: Copy files/folders between a container and the local filesystemdocker volume
: Manage Docker volumesdocker-compose build
: Build or rebuild services defined in adocker-compose.yml
filedocker-compose up
: Create and start containers defined in adocker-compose.yml
filedocker system prune
: Remove all unused containers, networks, images, and volumesdocker network create
: Create a new Docker networkdocker network connect
: Connect a container to a Docker networkdocker network disconnect
: Disconnect a container from a Docker networkdocker-compose down
: Stop and remove containers, networks, and volumes defined in adocker-compose.yml
filedocker-compose start
: Start services defined in adocker-compose.yml
filedocker-compose stop
: Stop services defined in adocker-compose.yml
filedocker-compose logs
: Display logs for services defined in adocker-compose.yml
filedocker-compose ps
: List the services defined in adocker-compose.yml
filedocker-compose run
: Run a one-time command on a service defined in adocker-compose.yml
file
These commands are just a few of the many available commands in Docker. It's essential to understand how Docker works and the different commands available before using it to manage containers and images. The official Docker documentation provides comprehensive guides and tutorials to help you get started.
************************************************************************
Thanks for reading! Hope you find this helpful.
Happy learning !!!
Suggestions are always welcome.
checkout my GitHub.
Thank You - Shubham Londhe