Skip to content

Instantly share code, notes, and snippets.

@frhan
Last active January 18, 2023 11:06
Show Gist options
  • Save frhan/74afd6ee7d6a597d0ec574f356f08687 to your computer and use it in GitHub Desktop.
Save frhan/74afd6ee7d6a597d0ec574f356f08687 to your computer and use it in GitHub Desktop.
Docker basic commands

How to get docker-compose to always re-create containers from fresh images?

Screenshot from 2023-01-18 12-05-23

Purging All Unused or Dangling Images, Containers, Volumes, and Networks

$ docker system prune

Remove any stopped containers and all unused images

$ docker system prune -a

docker save

$ docker save IMAGE > /path/to/file.tar docker save -o /path/to/file.tar IMAGE

docker save

Screenshot from 2022-12-02 00-35-18

docker with private repo

Screenshot from 2022-12-07 09-30-48

docker build with arguments

Screenshot from 2022-12-07 09-52-32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment