Some Docker recipes.
GitLab provides access tokens at various access levels, like API or Read Registry ones. To use them:
# Expliciting the token as password
docker login registry.gitlab.com -u user -p pass
# Without expliciting it (interactive mode)
docker login registry.gitlab.com -u user
After login, push and pulls of images from GitLab registries become available.
Filtering images to remove:
# Remove dangling images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
# Find images with a tag
docker images | grep 1.3.1
# Get their hashes
docker images | grep 1.3.1 | tr -s ' ' | cut -d ' ' -f 3
# Remove when very sure
docker rmi $(docker images | grep 1.3.1 | tr -s ' ' | cut -d ' ' -f 3)