canonical / deployment-configs

10 stars 12 forks source link

Untagging unused images at end of build jobs #58

Open nottrobin opened 6 years ago

nottrobin commented 6 years ago

To help keep the docker registry from running out of space, we should untag images that aren't needed by Kubernetes at the end, so they can be cleaned up.

tbille commented 5 years ago

This is done by renaming the tag with latest

nottrobin commented 5 years ago

I disagree.

We tag all our images with an ID, which is usually of the form {epoch_time_stamp}-{short_commit_id} - e.g. 1552351138-cc7170c. This tag name is then the tag name used inside Kubernetes to download the image.

We then also tag these images with latest, just for our own benefit so we can see what the latest image is, but this tag isn't actually used by Kubernetes.

We do nothing to remove previous ID-tags, so these will hang around forever.

The Docker CLI doesn't provide a way to delete image tags on the actual registry. It may be possible through the registry API, but I remember this not working properly last time I tried it...

sowasred2012 commented 2 years ago

@nottrobin @frankban is this still relevant?