Skip to content

Instantly share code, notes, and snippets.

@anuviswan
Last active July 21, 2023 05:37
Show Gist options
  • Save anuviswan/7a93d62be2a4cb46ae880da757088885 to your computer and use it in GitHub Desktop.
Save anuviswan/7a93d62be2a4cb46ae880da757088885 to your computer and use it in GitHub Desktop.

Docker commands

This document provides a quick overview of most commonly used Docker Commands

General

Check Version

$ docker version

Manage Containers

List of running containers

$ docker ps

List of containers, including non-running

$ docker ps -a

Remove stopped docker containers

$ docker container prune

Remove dangling images

$ docker image prune

To remove all unused images, not just dangling ones

$ docker image prune -a

Remove unused volumes

$ docker volume prune

Remove unused network

$ docker network prune

Remove all stopped container, unused images, networks etc (except volume)

$ docker system prune

To include unused volumes

$ docker system prune --volumes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment