Request an API (bearer) token from GitLab JWT authentication to control your private Docker registry
My continuous integration and continuous delivery pipeline use Docker containers and a private Docker registry to distribute and deploy my applications automatically. Unfortunately, the Docker command-line tool can’t really control the Docker registry, actually, it is only capable of pushing and pulling image (tags). This is a bit frustrating because, when you’re using your continuous integration pipeline to build containers, push them to the registry, and pull them again to run the QA, the registry will eat up all your disk space due the images are never removed. To clean up your ‘mess’, you have to remove the images manually, but it’s way cooler (and simpler) to use the Docker registry API for this job.