0% found this document useful (0 votes)
8 views2 pages

Docker Commands Explained Full

This document provides a comprehensive list of Docker commands along with their explanations. It covers commands for running containers, managing networks, and handling services, including examples like creating networks, stopping containers, and using Docker Compose. Each command is detailed to help users understand its functionality and usage.

Uploaded by

vkushwanth2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Docker Commands Explained Full

This document provides a comprehensive list of Docker commands along with their explanations. It covers commands for running containers, managing networks, and handling services, including examples like creating networks, stopping containers, and using Docker Compose. Each command is detailed to help users understand its functionality and usage.

Uploaded by

vkushwanth2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Docker Commands Explained

This document contains a list of Docker commands along with detailed explanations.

Command: docker run -d --name container3 --network mynetwork alpine

Explanation: Runs a new container 'container3' in detached mode with the 'alpine' image, connecting to the 'mynetwork'

network.

Command: docker exec -it container4 /bin/sh

Explanation: Executes a shell in 'container4' interactively.

Command: docker network create --driver bridge mynetwork

Explanation: Creates a new Docker network 'mynetwork' using the 'bridge' driver.

Command: docker network remove mynetwork

Explanation: Removes the Docker network 'mynetwork'.

Command: docker network inspect mynetwork

Explanation: Displays detailed information about the 'mynetwork' network.

Command: docker stop container3 container4

Explanation: Stops the running containers 'container3' and 'container4'.

Command: docker rm container3 container4

Explanation: Removes the stopped containers 'container3' and 'container4'.

Command: docker network inspect mynetwork

Explanation: Shows information about the 'mynetwork' network.

Command: docker run -d --name container3 --network mynetwork alpine

Explanation: Starts a new container named 'container3' with the 'alpine' image, in detached mode, and connected to
'mynetwork'.

Command: docker service create --name web --replicas 3 --network ovn nginx

Explanation: Creates a Docker service named 'web' with 3 replicas, connected to the 'ovn' network, using the 'nginx'

image.

Command: docker network create --driver overlay ovn

Explanation: Creates an overlay network named 'ovn', used for Docker Swarm services.

Command: docker ps

Explanation: Lists all the running containers.

Command: docker network ls

Explanation: Lists all Docker networks.

Command: docker ps -a

Explanation: Lists all containers, including stopped ones.

Command: docker logs container_name

Explanation: Shows logs of the specified container.

Command: docker-compose up

Explanation: Starts up all the services defined in the 'docker-compose.yml' file.

Command: docker-compose down

Explanation: Stops and removes all the containers, networks, and volumes defined in the 'docker-compose.yml' file.

You might also like