You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Garbage collector removed all blobs and corrupted the registry #4461
In a multi-arch manifests registry I cleaned up using registry garbage-collect /etc/docker/registry/config.yml and registry garbage-collect -m /etc/docker/registry/config.yml commands.
The second command removed almost all blobs in the registry. The manifests are still in place.
The storage decreased from 445G used to 4G, I don't even know if something is still useable.
After digging for all the missing blobs, it appears that only multi-platform OCI manifests are impacted and need to be removed from the repositories.
The manifests with only one platform were not impacted.
Unfortunately, yes, I have to confirm that cleanup doesn't work with multi-arch manifests which leads to the complete wipe of the all the layers of arch's mentioned in it.
I stumbled across this ticket after tracking down the mysterious disappearing of seemingly random images from our registry. Turned out it's the multi arch builds that disappear from our registry after each execution of the garbage-collect housekeeping process.
Some addition info:
we're using the current/latest registry:2 image
we're using S3 storage backend
we're NOT shutting down the registry while doing housekeeping - in fact we start up a second container with the same backend storage configuration, executing garbage-collect.
Just for my understanding: Is this an edge case scenario/caused by the fact we're not shutting down the actual registry? Because that seems like a pretty serious side effect/bug of running garbage-collect otherwise and I wonder why there are so few people stumbling across that issue.
I'm not sure to undertand @milosgajdos , registry:2 continues to receive updates as it points to the latest build in the version 2, and is currently pointing to version 2.8.3.
I was confused between code version and tag releases.
I'm not sure to undertand @milosgajdos , registry:2 continues to receive updates as it points to the latest build in the version 2, and is currently pointing to version 2.8.3.
You are confusing yourself and everyone who comes to this thread I'm afraid.
As this problem seems unsolved right now,
do you guys have a method to clean-up multi-platform images ?
My registry continues to grow and I will soon be out of disk space.
#!/bin/bash# registry:2 garbage collector does not work with multi platform images# leading to an out of space error# to get space back, we can use this script.# stop the current registry and change it's default port from 5000 to 5002# add another data disk and mount another fresh registry on the port 5000 # copy the images from the old registry to the new one# when the copy is done, delete the old registry and the old diskexport REGISTRY_SRC="127.0.0.1:5002"export REGISTRY_DST="127.0.0.1:5000"source .env
# from the .env file# export REGISTRY_USER=# export REGISTRY_PASS=
docker login -u="${REGISTRY_USER}" -p="${REGISTRY_PASS}"$REGISTRY_SRC
docker login -u="${REGISTRY_USER}" -p="${REGISTRY_PASS}"$REGISTRY_DST# Get the list of repositories
repos=$(curl -u "${REGISTRY_USER}:${REGISTRY_PASS}" -k -s -X GET http://$REGISTRY_SRC/v2/_catalog | jq -r '.repositories[]'| sort)forrepoin$repos;doecho"Processing ${repo}"
tags=$(curl -u "${REGISTRY_USER}:${REGISTRY_PASS}" -k -s -X GET http://$REGISTRY_SRC/v2/${repo}/tags/list |jq -r '.tags[]')fortagin$tags;doecho"Copying ${repo}:${tag}"
./regctl image copy $REGISTRY_SRC/${repo}:${tag}$REGISTRY_DST/${repo}:${tag}donedone
Activity
mobidyc commentedon Sep 11, 2024
Issue maybe related to #3178
After digging for all the missing blobs, it appears that only multi-platform OCI manifests are impacted and need to be removed from the repositories.
The manifests with only one platform were not impacted.
AleksandrNull commentedon Oct 20, 2024
Unfortunately, yes, I have to confirm that cleanup doesn't work with multi-arch manifests which leads to the complete wipe of the all the layers of arch's mentioned in it.
proligde commentedon Nov 29, 2024
I stumbled across this ticket after tracking down the mysterious disappearing of seemingly random images from our registry. Turned out it's the multi arch builds that disappear from our registry after each execution of the garbage-collect housekeeping process.
Some addition info:
registry:2imageJust for my understanding: Is this an edge case scenario/caused by the fact we're not shutting down the actual registry? Because that seems like a pretty serious side effect/bug of running garbage-collect otherwise and I wonder why there are so few people stumbling across that issue.
milosgajdos commentedon Nov 29, 2024
I dont know if this issue is fixed in the latest release, but please don't use
v2: it hasnt got any updates for years, neither will it get any.mobidyc commentedon Dec 13, 2024
EDIT: wrong assertion on my side:
I was confused between code version and tag releases.
milosgajdos commentedon Dec 13, 2024
You are confusing yourself and everyone who comes to this thread I'm afraid.
The last code update
v2.8received was 11 months ago; you can see for yourself https://github.com/distribution/distribution/tree/release/2.8As for the images, again, please refrain from confusing folks visiting this thread. Get yourself familiar with the registry official image tags: https://hub.docker.com/_/registry/tags
latesttag does not mean latest release; it meanslateststable release which in this case isv2.8asv3has only had alpha, beat and most recently 1st release candidate: those are also available via GitHub Registry https://github.com/distribution/distribution/pkgs/container/distributionFinally, we also maintain https://hub.docker.com/r/distribution/distribution/tags
mobidyc commentedon Dec 27, 2024
Thank you for these explanations @milosgajdos, and sorry for the confusion, I will edit my post to not confuse other people.
mobidyc commentedon Dec 27, 2024
As this problem seems unsolved right now,
do you guys have a method to clean-up multi-platform images ?
My registry continues to grow and I will soon be out of disk space.
mobidyc commentedon Dec 28, 2024
putting it here for contribution