Common Docker CLI Commands Overview
This article provides a concise reference of essential Docker command‑line operations, including searching, pulling, listing, running, inspecting, managing containers and images, and additional utilities, helping developers, testers, and operations engineers efficiently work with Docker without a graphical interface.
docker search searches Docker Hub for images, e.g., docker search nginx or docker search tomcat.
docker pull downloads an image from the registry, for example docker pull docker.io/nginx or docker pull docker.io/tomcat.
docker images lists all locally stored images.
docker run creates and starts a container; examples include docker run -itd docker.io/nginx /bin/bash for an interactive daemon, and docker run -p 80:80 -itd docker.io/nginx /bin/bash to map host port 80 to container port 80.
docker ps shows running containers, while docker ps -a lists all containers, including stopped ones.
docker inspect displays detailed container information, e.g., docker inspect 55e339c80051, and can be piped to grep to filter IP addresses.
docker exec runs a command inside a running container, such as docker exec 55e339c80051 df -h or docker exec -it 55e339c80051 /bin/bash for an interactive shell.
docker stop and docker start stop and start containers, e.g., docker stop 55e339c80051 and docker start 55e339c80051.
docker kill force‑kills a running container, e.g., docker kill 55e339c80051.
docker rm removes a stopped container ( docker rm dc455c12ca7d) or forces removal of a running one ( docker rm -f 55e339c80051).
docker rmi deletes images from the local store, e.g., docker rmi 78b258e36eed or multiple images docker rmi e81eb098537d 415381a6cb81.
Additional commands mentioned for future reference include docker push, docker history, docker attach, docker build, docker commit, docker cp, docker create, docker diff, docker events, docker export, docker import, docker load, docker login, docker logout, docker logs, docker port, docker pause, docker restart, docker save, docker tag, docker top, docker unpause, docker version, and docker wait.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
