Hi,
please add a cleanup script to your repo.
After finishing the course one should be able to easily get rid of everything.
The easiest way would be to label all your images, volumes, and networks.
Open Container Initiative - Pre-Defined Annotation Keys
Dockerfile - LABEL
Compose file / Networks / labels
Compose file / Volumes / labels
Compose file / Services / labels
Dockerfile
LABEL org.opencontainers.image.vendor="io.diveinto"
docker-compose.yml
networks:
diveinto.io:
name: diveinto.io
labels:
org.opencontainers.image.vendor: io.diveinto
You currently use anonymous volumes, so you might want to convert them to named volumes with a label and/or you might want to update your README:
⇒
docker compose rm / options
Instead of (in addition to) org.opencontainers.image.vendor you might want to use your own label io.diveinto.docker.group="diveintoansible-lab" for example.
This is how the cleanup script could look like:
#!/usr/bin/env sh
set -eu
readonly label="org.opencontainers.image.vendor=io.diveinto"
docker-compose rm -v
docker container prune --force --filter="label=${label}"
docker volume prune --force --all --filter="label=${label}"
docker image prune --force --all --filter="label=${label}"
docker network prune --force --filter="label=${label}"
docker image prune - filtering
Hi,
please add a cleanup script to your repo.
After finishing the course one should be able to easily get rid of everything.
The easiest way would be to label all your images, volumes, and networks.
Open Container Initiative - Pre-Defined Annotation Keys
Dockerfile - LABEL
Compose file / Networks / labels
Compose file / Volumes / labels
Compose file / Services / labels
Dockerfile
docker-compose.yml
You currently use anonymous volumes, so you might want to convert them to named volumes with a label and/or you might want to update your README:
diveintoansible-lab/README.md
Line 191 in b9205df
⇒
docker compose rm / options
Instead of (in addition to)
org.opencontainers.image.vendoryou might want to use your own labelio.diveinto.docker.group="diveintoansible-lab"for example.This is how the cleanup script could look like:
docker image prune - filtering