List of commands used for Docker

In Docker, you can use various types of commands to interact with the Docker engine and manage containers, images, networks, and volumes. Here are the main types of commands used in Docker:

  1. Management Commands: These commands are used to manage Docker resources like containers, images, networks, and volumes. Examples include docker run, docker stop, docker rm, docker images, docker network, and docker volume. These commands allow you to create, start, stop, remove, and inspect Docker resources.

  2. Build Commands: These commands are used to build Docker images from Dockerfiles or other build contexts. The primary build command is docker build, which allows you to specify the build context and Dockerfile to create an image. Additional build-related commands include docker commit (creates an image from a container) and docker tag (adds tags to an image).

  3. Registry Commands: These commands are used to interact with Docker registries, which store Docker images. The main registry commands are docker pull (downloads an image from a registry), docker push (uploads an image to a registry), and docker search (searches for images in a registry).

  4. Execution Commands: These commands are used to execute commands within a running Docker container. The primary execution command is docker exec, which allows you to run a command in a running container. You can also use docker attach to attach to a running container's input/output, or docker run with the --entrypoint option to override the default entrypoint.

  5. Information Commands: These commands provide information about Docker resources and configurations. Examples include docker info (displays Docker system information), docker version (displays Docker version information), and docker inspect (provides detailed information about Docker objects like containers, images, networks, and volumes).

These are the main types of commands used in Docker. By combining these commands and their options, you can effectively manage and work with Docker containers and images.

Here's a list of commonly used commands for Docker:

  1. Management Commands:

    • docker run: Create and start a new container from an image.

    • docker stop: Stop a running container.

    • docker start: Start a stopped container.

    • docker restart: Restart a running container.

    • docker rm: Remove one or more containers.

    • docker rmi: Remove one or more images.

    • docker ps: List running containers.

    • docker images: List downloaded images.

    • docker inspect: Display detailed information about a container, image, network, or volume.

    • docker logs: Fetch the logs of a container.

    • docker exec: Run a command in a running container.

    • docker cp: Copy files/folders between a container and the local filesystem.

  2. Build Commands:

    • docker build: Build a Docker image from a Dockerfile.

    • docker commit: Create an image from a container's changes.

    • docker tag: Add a tag to an image.

  3. Registry Commands:

    • docker pull: Download an image or a repository from a registry.

    • docker push: Upload an image or a repository to a registry.

    • docker search: Search for images in a registry.

  4. Network Commands:

    • docker network create: Create a network.

    • docker network ls: List networks.

    • docker network inspect: Display detailed information about a network.

  5. Volume Commands:

    • docker volume create: Create a volume.

    • docker volume ls: List volumes.

    • docker volume inspect: Display detailed information about a volume.

  6. System Commands:

    • docker info: Display system-wide information about Docker.

    • docker version: Show Docker version information.

    • docker system prune: Remove unused resources such as stopped containers, unused networks, and dangling images.

These commands cover the essential operations for managing Docker containers, images, networks, volumes, and the Docker system itself. Keep in mind that there are many more commands available with additional options and functionalities. You can explore further by referring to the Docker documentation for a comprehensive list of commands and their usage.