സെഫിർനെറ്റ് ലോഗോ

കണ്ടെയ്‌നറുകൾ നിർമ്മിക്കുന്നതിനും പ്രവർത്തിപ്പിക്കുന്നതിനും നിയന്ത്രിക്കുന്നതിനുമുള്ള 20+ ഡോക്കർ കമാൻഡുകൾ

തീയതി:

അവതാരിക

Docker is an open-source platform that gives developers everything they need to create, package, and deploy applications in a streamlined way. With Docker’s container technology, you can bundle your applications and all their dependencies into a single, self-contained unit that can easily be moved across different platforms and run seamlessly in containers. However, to make the most of what Docker offers, you must get comfortable with its command-line interface (CLI). In this article, we’ll walk you through the must-know Docker commands every developer and system administrator should have in their toolkit.

Docker Commands

ഉള്ളടക്ക പട്ടിക

Why Do You Need Docker Commands?

Docker commands are essential for managing and interacting with Docker containers and images. It includes creating, running, stopping, deleting containers, and creating images from Dockerfiles. In addition, it enables the ability to run tasks such as listing live containers, checking container status, transferring files between the host machine and containers, and managing Docker networks and Docker volumes. In use, it is impossible to achieve the desired state of utilizing Docker in containerizing applications, achieving portability and making it easy to deploy it across various platforms.

How to Use Docker Commands?

Here are some common ways to use Docker commands:

  1. Run a containerdocker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...] This command creates and starts a new container from the specified image.
  2. List running containersdocker ps Lists all currently running containers.
  3. ഒരു കണ്ടെയ്നർ നിർത്തുകdocker stop CONTAINER_ID Stops the running container specified by its ID or name.
  4. Remove a containerdocker rm CONTAINER_ID Removes the stopped container from the system.
  5. Pull an imagedocker pull IMAGE[:TAG|@DIGEST] Downloads the specified image from a registry (e.g., Docker Hub).
  6. Build an imagedocker build [OPTIONS] PATH | URL | - Builds a new image from the instructions in a Dockerfile.
  7. ചിത്രങ്ങൾ ലിസ്റ്റ് ചെയ്യുകdocker images Lists all available images on the local system.
  8. Remove an imagedocker rmi IMAGE[:TAG|@DIGEST] Removes the specified image from the local system.
  9. Run a command in a containerdocker exec [OPTIONS] CONTAINER_ID COMMAND [ARG...] Runs the specified command within a running container.
  10. View logsdocker logs CONTAINER_ID Fetches the logs of the specified container.

These are just a few examples. Below, I have provided a list of docker commands. You can also explore more commands and their options by running docker --help അല്ലെങ്കിൽ റഫർ ചെയ്യുക ഔദ്യോഗിക ഡോക്കർ ഡോക്യുമെന്റേഷൻ.

Here is the list of Top Docker Commands

Docker Version

ദി docker version command displays the current version of Docker installed on your system. It provides information about the Docker client and server versions as well as various other details such as the operating system, architecture, and kernel version.

ഉപയോഗം

docker version

docker search 

ദി docker search command allows you to search for Docker images on Docker Hub, the official registry for Docker images. You can search for images by name or use keywords to find relevant images.

ഉപയോഗം

docker search <image_name>

ഡോക്കർ പുൾ 

ദി docker pull command downloads a Docker image from a registry (such as Docker Hub) to your local machine. You need to pull an image from it before creating a container.

ഉപയോഗം

docker pull <image_name>:<tag>

ഡോക്കർ റൺ

ദി docker run command is one of the most frequently used Docker commands. It creates a new container from a specified image and starts it. You can pass various options to customize the container’s behavior, such as exposing ports, mounting volumes, and setting environment variables.

ഉപയോഗം

docker run [OPTIONS] <image_name>:<tag> [COMMAND] [ARG...]

ഡോക്കർ ps 

ദി docker ps command lists all the currently running containers on your system. By default, it shows only the running containers, but you can use the -a flag to list all containers (running and stopped).

ഉപയോഗം

docker ps
docker ps -a

docker stop

ദി docker stop command stops one or more running containers. You can specify the container by its name or ID.

ഉപയോഗം

docker stop <container_name_or_id>

docker restart 

ദി docker restart command restarts one or more running containers. It first stops the container(s) and then starts them again.

ഉപയോഗം

docker restart <container_name_or_id>

docker kill

ദി docker kill command forcibly stops a running container by sending a KILL signal. It should be used when the docker stop command fails to stop a container gracefully.

ഉപയോഗം

docker kill <container_name_or_id>

docker exec 

ദി docker exec command runs a new command inside a running container. This is useful for inspecting or troubleshooting containers without starting a new shell.

ഉപയോഗം

docker exec [OPTIONS] <container_name_or_id> [COMMAND] [ARG...]

ഡോക്കർ ലോഗിൻ 

ദി docker login command authenticates you with a Docker registry, such as Docker Hub. You need to be authenticated to push images to a registry.

ഉപയോഗം

docker login [OPTIONS] [SERVER]

ഡോക്കർ നിരാകരിക്കുക

ദി docker commit command creates a new image from a container’s changes. This is useful for capturing the state of a running container and creating a new image based on that state.

ഉപയോഗം

docker commit [OPTIONS] <container_name_or_id> [REPOSITORY[:TAG]]

ഡോക്കർ പുഷ്

ദി docker push command uploads an image to a Docker registry, such as Docker Hub. You need to be authenticated with the registry before pushing an image.

ഉപയോഗം

docker push <image_name>:<tag>

ഡോക്കർ നെറ്റ്‌വർക്ക്

ദി docker network command manages Docker networks. It allows you to create, inspect, and manage networks for communication between containers.

ഉപയോഗം

docker network [COMMAND] [ARG...]

docker history

ദി docker history command shows the history of an image, including the layers that make up the image and the commands used to create each layer.

ഉപയോഗം

docker history <image_name>:<tag>

ഡോക്കർ rmi

ദി docker rmi command removes one or more images from your local system. You need to stop and remove all containers based on the image before removing the image itself.

ഉപയോഗം

docker rmi <image_name>:<tag>

ഡോക്കർ ps -a

ദി docker ps -a command lists all containers (running and stopped) on your system. It’s a useful command for getting an overview of all the containers on your machine.

ഉപയോഗം

docker ps -a

docker copy

ദി docker copy command copies files or directories between a container and the local filesystem.

ഉപയോഗം

docker copy [OPTIONS] <container_name_or_id>:<src_path> <dest_path>
docker copy [OPTIONS] <src_path> <container_name_or_id>:<dest_path>

ഡോക്കർ ലോഗുകൾ

ദി docker logs command retrieves log output from a container. It’s an essential command for troubleshooting and debugging containers.

ഉപയോഗം

docker logs [OPTIONS] <container_name_or_id>

docker volume

ദി docker volume command manages Docker volumes. Volumes are used to persist data generated by Docker containers.

ഉപയോഗം

docker volume [COMMAND]

docker logout

ദി docker logout command logs out from a Docker registry.

ഉപയോഗം

docker logout [SERVER]

Now, you know just a few essential Docker commands, but Docker comes with many more commands and options that help you manage and work with containers. In the longer examples above, the Docker command-line interface offers a powerful and flexible method to interact with Docker containers and images. When pulling images from a registry, running containers, or managing networks and volumes, these Docker commands optimize your workflow and maximize the potential of container technology.

ഇതും വായിക്കുക: End-to-End Guide to Docker for aspiring Data Engineers

Bonus: Additional Commands

docker ചിത്രങ്ങൾ

Lists all Docker images in your local repository.

  • ഉപയോഗം: docker images
  • ഔട്ട്പുട്ട്: Displays image ID, repository name, tag, and size of each image.

ഡോക്കർ rm

Removes one or more Docker containers.

  • ഉപയോഗം: docker rm [container_id or container_name]
  • ഔട്ട്പുട്ട്: Deletes the specified container(s).

ഡോക്കർ ബിൽഡ്

Builds a Docker image from a Dockerfile.

  • ഉപയോഗം: docker build [options] [path]
  • ഓപ്ഷനുകൾ:
    • -t repository:tag to specify the repository and tag for the built image.
    • -f Dockerfile to specify a Dockerfile other than the default one in the build context.

ഇതും വായിക്കുക: Docker Tutorial: Step-by-Step Tutorial for Beginners

തീരുമാനം

In conclusion, these top Docker commands are designed to help manage containers, images, networks, logs, and other resources such as volumes. Once you have learned how to use these commands, you can accomplish multiple tasks, including running containers, watching logs, managing images, and working with volumes. Try using these commands in your Docker projects to improve your work and get the most out of the Docker platform.

In the comment section, please let us know how useful these Docker commands are for you. We would love to hear from you.

സ്പോട്ട്_ഐഎംജി

ഏറ്റവും പുതിയ ഇന്റലിജൻസ്

സ്പോട്ട്_ഐഎംജി