List all Docker containers without a specific label

List and find containers without a specific label

docker ps -aq | grep -v -E $(docker ps -aq --filter='label=deunhealth.restart.on.unhealthy' | paste -sd "|" -) | while read line ; do docker ps --filter "id=$line" --format "{{.Names}}"; done
All containers without label "deunhealth.restart.on.unhealthy"
docker ps -aq | grep -v -E $(docker ps -aq --filter='label=deunhealth.restart.on.unhealthy' | paste -sd "|" -) | while read line ; do name=$(docker ps --filter "id=$line" --format "{{.Names}}") && if [[ $name != "deunhealth" ]]; then echo "$name"; fi; done
All containers without label "deunhealth.restart.on.unhealthy" except the one named "deunhealth"
Looking for help?
If you are looking for some help or want a quick chat, please head over to the Discord Community!