Skip to content

Instantly share code, notes, and snippets.

@yeromin
Last active October 31, 2018 21:21
Show Gist options
  • Save yeromin/9e1b4dd11b9e716cc1b2f20404b274a5 to your computer and use it in GitHub Desktop.
Save yeromin/9e1b4dd11b9e716cc1b2f20404b274a5 to your computer and use it in GitHub Desktop.

Docker commands

docker-compose up
docker-compose up -d
docker-compose down && docker-compose up --build

docker system prune

This will remove:

- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all images without at least one container associated to them

List all containers (only IDs):

docker ps -aq

Stop all running containers:

docker stop $(docker ps -aq)

Remove all containers:

docker rm $(docker ps -aq)

Remove all images:

docker rmi $(docker images -q)

Remove containers if password supplied is incorrect:

docker-library/mysql#51 (comment) docker-compose rm -v

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