- Remove all stopped containers
docker container prune
- Remove all dangling images
# list
docker images -f dangling=true
# remove
docker rmi $(docker images -f dangling=true -q)
- Build image in current folder
docker build --tag <image_name> .
- Run an image and remove container after exit(--rm)
docker run --rm -it <image_name>