Docker commands:
- To build an image from a Dockerfile.
- docker build -t <image_name> .
- Runs a command in a new container.
- docker run -d --name <container-name> -p 80:80 <image-name>
- Starts one or more stopped containers.
- docker start <container-name>
- Stops one or more running containers.
- docker stop <container-name>
- Pulls an image or a repository from a registry.
- docker pull <image-name:tag>
- Pushes an image or a repository to a registry.
- docker push <image-name:tag>
- Runs a command in a running container and go inside a container.
- docker exec -it <container-name or ID> bash
- Removes one or more containers.
- docker rm <container-name or ID>
- Removes one or more images.
- docker rmi <image-name>
- Lists all the images on the local system.
- docker images
- Lists all running containers.
- docker ps
路 Fetches the logs of a container.
- docker logs <container-name or ID>
- Returns low-level information on a container or image.
- docker inspect <container-name or ID>
Docker Volume:
- Create a volume.
- docker volume create <volume-name>
- List volumes.
- docker volume ls
- Display detailed information on one or more volumes.
- docker volume inspect <volume-name>
- Remove one or more volumes.
- docker volume rm <volume-name>
- Remove all unused volumes.
- docker volume prune
Docker Compose:
- Create and start containers.
- docker-compose up
- List containers.
- docker-compose ps
- Stop and remove containers, networks, images, and volumes.
- docker-compose down
- Show logs.
- docker-compose logs <service>
#Docker #90DaysOfDevOps #DevOps #Cloud #DockerForDevOps
聽