What is Docker?
Docker is an open source platform that enables developers to build, deploy, run, update, and manage containers. Containers are standardized, executable components that combine appl...
Docker
Certainly! Docker is a popular platform for containerization, and it comes with a variety of commands to manage containers, images, networks, and volumes. Here's a list of some commonly used Docker commands, with examples:
### Container Management:
1. Docker run:
-Creates and starts a container from an image.
$ docker run -d --name my_container nginx
2. Docker ps:
-Lists running containers.
$ docker ps
3. docker ps -a:
-Lists all containers (running and stopped).
$ docker ps -a
4. Docker stop:
-Stops a running container.
$ docker stop my_container
5. Docker start:
-Starts a stopped container.
$ docker start my_container
6. Docker restart:
-Restarts a container.
$ docker restart my_container
7. Docker exec:
- Executes a command in a running container.
$ docker exec -it my_container bash
8. Docker rm:
- Removes one or more containers.
$ docker rm my_container
### Image Management:
9. Docker images:
- Lists all available images.
$ docker images
10. Docker pull:
- Pulls an image from a registry.
$ docker pull ubuntu:latest
11. Docker rmi:
- Removes one or more images.
$ docker rmi ubuntu:latest
12. Docker build:
- Builds a Docker image from a Dockerfile.
$ docker build -t custom_image:tag .
### Network Management:
13. docker network ls:
- Lists all networks.
$ docker network ls
14. docker network create:
- Creates a new network.
$ docker network create my_network
15. docker network connect:
- Connects a container to a network.
$ docker network connect my_network my_container
### Volume Management:
16. docker volume ls:
- Lists all volumes.
$ docker volume ls
17. Docker volume create:
- Creates a new volume.
$ docker volume create my_volume
18. Docker volume inspect:
- Displays detailed information about a volume.
$ docker volume inspect my_volume
These are just a few examples, and there are many more Docker commands available. You can explore the Docker documentation for more in-depth information: [Docker CLI documentation](https://docs.docker.com/engine/reference/commandline/docker/).
Sign in to join the discussion.
Docker is an open source platform that enables developers to build, deploy, run, update, and manage containers. Containers are standardized, executable components that combine appl...
Subscribe for technical articles from iTechOrbit.