Always learning
4 min readAug 20, 2023

--

Docker — Full Commands…

Docker is basically a software program which enables OS-level virtualization or abstraction.

Extensive list of Docker commands with their uses:

🔸docker run: Create and start a new container from a Docker image.
🔸docker build: Build a Docker image from a Dockerfile.
🔸docker pull: Pull a Docker image from a container registry.
🔸docker push: Push a Docker image to a container registry.
🔸docker images: List all Docker images on your local machine.
🔸docker ps: List running containers.
🔸docker exec: Execute a command within a running container.
🔸docker stop: Stop a running container.
🔸docker rm: Remove one or more containers.
🔸docker rmi: Remove one or more Docker images.
🔸docker network create: Create a new Docker network.
🔸docker network ls: List Docker networks.
🔸docker network inspect: Display detailed information about a Docker network.
🔸docker network connect: Connect a container to a Docker network.
🔸docker network disconnect: Disconnect a container from a Docker network.
🔸docker volume create: Create a Docker volume.
🔸docker volume ls: List Docker volumes.
🔸docker volume inspect: Display detailed information about a Docker volume.
🔸docker volume rm: Remove a Docker volume.
🔸docker-compose up: Start and run a multi-container Docker application defined in a Docker Compose file.
🔸docker-compose down: Stop and remove containers, networks, and volumes created by “docker-compose up”.
🔸docker-compose build: Build Docker images for services defined in a Docker Compose file.
🔸docker-compose logs: View the logs of services running with “docker-compose”.
🔸docker-compose ps: List containers created by “docker-compose”.
🔸docker login: Log in to a container registry.
🔸docker logout: Log out from a container registry.
🔸docker inspect: Display detailed information about a Docker object (container, image, volume, etc…)
🔸docker cp: Copy files/folders between a container and the host machine.
🔸docker attach: Attach to a running container’s STDIN, STDOUT, and STDERR.
🔸docker rename: Rename a Docker container.
🔸docker restart: Restart a Docker container.
🔸docker pause: Pause a running container.
🔸docker unpause: Unpause a paused container.
🔸docker top: Display the running processes of a container.
🔸docker stats: Display real-time usage statistics of containers.
🔸docker events: Stream real-time events from the Docker server.
🔸docker port: List port mappings of a container.
🔸docker save: Save a Docker image to a tar archive.
🔸docker load: Load a Docker image from a tar archive.
🔸docker commit: Create a new image from a container’s changes.

🔸docker export: Export the contents of a container’s filesystem as a tar archive.
🔸docker system prune: Remove unused Docker objects (containers, images, networks, volumes, etc...)
🔸docker run --rm: Run a container and automatically remove it when it exits.
🔸docker run -it: Run a container in interactive mode with a pseudo-TTY.
🔸docker run -p: Map a container’s port to the host machine.
🔸docker run -v: Mount a volume from the host machine into a container.
🔸docker run -e: Set environment variables for a container.
🔸docker run --name: Assign a custom name to a container.
🔸docker run --network: Connect a container to a specified Docker network.
🔸docker run --link: Link a container to another container.
🔸docker network prune: Remove unused Docker networks.
🔸docker volume prune: Remove unused Docker volumes.
🔸docker image prune: Remove unused Docker images.
🔸docker container prune: Remove stopped containers.
🔸docker exec -it: Execute a command within a running container in interactive mode.
🔸docker logs: Fetch the logs of a container.
🔸docker inspect --format: Retrieve specific information about a Docker object using a Go template.
🔸docker cp: Copy files/folders between a container and the host machine.
🔸docker events: Stream real-time events from the Docker server.
🔸docker diff`: Show changes to files and directories within a container’s filesystem.

🔸docker top: Display the running processes of a container.
🔸docker stats: Display real-time CPU, memory, and network usage of containers.
🔸docker attach: Attach to a running container’s STDIN, STDOUT, and STDERR.
🔸docker import: Import the contents of a tarball as a new filesystem image.
🔸docker export: Export the contents of a container’s filesystem as a tar archive.
🔸docker wait: Block until a container stops, and then print its exit code.
🔸docker update: Update configuration of one or more containers.
🔸docker start: Start one or more stopped containers.
🔸docker pause: Pause all processes within one or more containers.
🔸docker unpause: Unpause all processes within one or more containers.
🔸docker kill: Kill one or more running containers.
🔸docker restart: Restart one or more containers.
🔸docker logs: Fetch the logs of a container.
🔸docker stats: Display real-time CPU, memory, and network usage of containers.

🔸docker attach: Attach to a running container’s STDIN, STDOUT, and STDERR.
🔸docker prune: Remove all stopped containers, unused networks, and dangling images.
🔸docker image history: Show the history of an image, including intermediate image layers.
🔸docker image inspect: Display detailed information about a Docker image.
🔸docker image tag: Tag a Docker image to a repository.
🔸docker image build: Build a Docker image from a Dockerfile.

🔸docker swarm init: Initialize a swarm on the current node and make it the manager.
🔸docker swarm join: Join a swarm as a worker node.
🔸docker swarm join-token: Manage join tokens for worker and manager nodes.
🔸docker swarm leave: Make the current node leave the swarm.
🔸docker node ls: List nodes in the swarm.
🔸docker service create: Create a new service, specifying the desired state, replicas, etc.
🔸docker service ls: List services running in the swarm.
🔸docker service inspect: Display detailed information about a service.
🔸docker service update: Update a service with new configurations.
🔸docker service scale: Scale a service to a specified number of replicas.
🔸docker service rm: Remove a service from the swarm.

--

--

Always learning
Always learning

Written by Always learning

கற்றுக் கொள்ளும் மாணவன்...

No responses yet