Docker Day 3 - Basic Docker Commands

Amman FarooqueAmman Farooque
1 min read

Here’s what I practiced and learned:

  1. docker --version – To check the installed Docker version

  2. docker search <image-name> – To search for images on Docker Hub

  3. docker pull <image-name> – To download images from Docker Hub

  4. docker images – To list all locally stored images

  5. docker ps – To list running containers

  6. docker ps -a – To list all containers (running + stopped)

  7. docker run <image> – To create and start a container from an image

  8. docker stop <container-id> / docker start <container-id> – To manage container lifecycle

  9. docker rm <container-id> / docker rmi <image-id> – To remove containers and images

  10. docker exec -it <container-id> bash – To interact with a running container

  11. docker attach <container-id> – To attach to a running container’s terminal

  12. docker build -t <image-name> . – To build an image from a Dockerfile

Using these commands, I now have a better grasp of how to search, pull, run, manage, and clean up Docker containers and images—skills that form the backbone of working with containerized applications.

0
Subscribe to my newsletter

Read articles from Amman Farooque directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Amman Farooque
Amman Farooque