Docker Commands The Ultimate Cheat Sheet
Last updated on February 11, 2021
Docker is a containerization system. Docker packages and runs the application with its dependencies inside a container. Containers are a standardized unit of software that allows developers to isolate their app from its environment. Docker simplifies the entire workflow, you do not have to worry about different languages, frameworks, interfaces, architectures. Below I have listed some Docker commands. You can also find the entire docker documentation by clicking this link.
Download Latest Docker Engine using only one command (linux)
Docker start container: Start a particular container. Docker stop container: Stop a particular container. Docker exec -ti container command: Run a shell command inside a particular container. Docker run -ti — image image container command: Create and start a container at the same time, and then run a command inside it. Docker Cheat Sheet Process Management # Show all running docker containers docker ps. # Execute a command on a container docker exec -it /bin/bash. Docker run: # Run a container and connect to it docker run -it: # Run a container in the background docker run -d: # Stop a container docker stop # Kill a container docker kill Images/Repository # List available local images docker images # Search for docker images docker search.
Check Docker Version
Search available Docker images on Docker hub
Pull Docker image from online hub
Note: In the OFFICIAL column, OK indicates an image built and supported by the company behind the project.
- Here’s a cheat sheet on the top Docker commands to know and use. (This is part of our Docker Guide. Use the right-hand menu to navigate.) Images and containers. The docker command line interface follows this pattern: docker COMMAND docker images docker container. The docker images and container commands grant access to the images.
- Docker container rm -f $(docker ps -aq) Print the last 100 lines of a container’s logs docker container logs –tail 100 web; DOCKER MANAGE COMMANDS. All commands below are called as options to the base docker command. Run docker command –help for more information on a particular command.
List all images in local docker engine
Run Apache Docker container with web files mounted and port exposed
To list all running containers
To list all running as well as stopped containers
Build Docker image in local environment from Dockerfile which is in current directory
Screencast free for mac. Tag Docker image with specified version number
Push Docker image to registry
Run commands inside running container
If you have made changes in container, which you want to store
Stop a running container
Delete stopped container
Delete running container
To remove docker image from local system
To remove unwanted folders from stopped and deleted docker containers
This command will deleted all stopped containers, deleted container’s volume and logs, not used networks
Drafted On,
January 6, 2021
DevOps
identicalCloud.com