Skip to content

Instantly share code, notes, and snippets.

@pj8912
Created March 18, 2026 08:05
Show Gist options
  • Select an option

  • Save pj8912/3d8a0e51872522745ffcabd2062fced4 to your computer and use it in GitHub Desktop.

Select an option

Save pj8912/3d8a0e51872522745ffcabd2062fced4 to your computer and use it in GitHub Desktop.
21 Docker Commands Every Developer Needs to Know

Docker Commands

System & Version Information

  • docker --version: Check the installed version of Docker.

Image Management

  • docker pull: Download an image from Docker Hub.
  • docker images: List all images currently on your local machine.
  • docker rmi: Remove an image from your local system.
  • docker save: Save an image to a tar file for sharing.

Container Lifecycle

  • docker create: Create a new container from an image without starting it.
  • docker start: Start a created container.
  • docker run: Pull, create, and start a container in one command.
  • docker pause: Pause all processes within a container.
  • docker stop: Gracefully stop a running container.
  • docker kill: Immediately force a container to stop.
  • docker rm: Remove a stopped container.

Container Inspection & Management

  • docker ps: List running containers (use -a to list all containers).
  • docker rename: Rename an existing container.
  • docker port: List port mappings for a container.
  • docker stats: View live resource usage statistics (CPU/Memory).
  • docker exec: Run a command inside a running container.

Registry & Customization

  • docker commit: Create a new image from a container's changes.
  • docker login: Log in to a Docker registry.
  • docker push: Upload an image to Docker Hub.
  • docker logout: Log out from a Docker registry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment