Skip to content

Instantly share code, notes, and snippets.

@sostenesapollo
Last active February 20, 2022 19:49
Show Gist options
  • Save sostenesapollo/2ae03d138e2a0aeb65d00e75e50ec0b8 to your computer and use it in GitHub Desktop.
Save sostenesapollo/2ae03d138e2a0aeb65d00e75e50ec0b8 to your computer and use it in GitHub Desktop.

Delete all containers using the following command:

docker rm -f $(docker ps -a -q)

Delete all volumes using the following command

docker volume rm $(docker volume ls -q)

Remove all images

docker rmi -f $(docker images -aq)

List containers

docker ps -a

Execute terminal in a running container

docker exec -it container_name /bin/bash

Remove container

docker remove container xxxx

Remove all containers

docker container prune

Build container based on dockerfile

docker build -t clean-node-api .

Remove all existing images

docker rmi -f $(docker images -a -q)

Stop running container

docker stop image_id

Run in interative mode

docker run -it image sh

Publish

docker run -p 5000:5000 clean-node-api

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