Skip to content

Instantly share code, notes, and snippets.

@kocisov
Created September 3, 2024 15:02
Show Gist options
  • Save kocisov/705bdbb5e5a22504ff1e4cbc164b0b37 to your computer and use it in GitHub Desktop.
Save kocisov/705bdbb5e5a22504ff1e4cbc164b0b37 to your computer and use it in GitHub Desktop.
dockering

dockering

Docker & Stuff

Stop and remove all filtered containers

# to filter by image name
FILTER=ancestor=$1

# to filter by container name (supports wildcard)
FILTER=name=$1

docker rm $(docker stop $(docker ps -a -q --filter $FILTER))

Remove all containers /w volumes

docker rm -vf $(docker ps -aq)

Remove all images

docker rmi -f $(docker images -aq)

Tail all logs

docker ps -q | xargs -L 1 docker logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment