docker - torles private registry-bol

 ( ardi | 2019. február 11., hétfő - 12:34 )

Sziasztok,

lehetseges private docker registry-bol "tisztan" image-eket torolni?
Letezik vmi CLI megoldas?

debian 9.5 alatt

docker --version
Docker version 18.09.0, build 4d60db4

registry:2.4.0-val probalkozom, de a blobs konyvtarban megmaradnak a fajlok az sha256 konyvtarban.

docker run -d -p 5001:5000 --name registry -v /srv/registry/data:/var/lib/registry --restart always registry:2.4.0

ezzel probalkoztam:

rm -r /srv/registry/data/docker/registry/v2/repositories/ubuntu/_manifests/tags/18.10/index/sha256/cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
rm -r /srv/registry/data/docker/registry/v2/repositories/ubuntu/_manifests/revisions/sha256/cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
docker exec registry bin/registry garbage-collect --dry-run /etc/docker/registry/config.yml
rm -r /srv/registry/data/docker/registry/v2/repositories/registry/_manifests/tags/2.4.0/index/sha256/33eee7b677acccc9d2130eb4f6c10032f2ddc194803c6cc31f7c610972806fd4
rm -r /srv/registry/data/docker/registry/v2/repositories/registry/_manifests/revisions/sha256/33eee7b677acccc9d2130eb4f6c10032f2ddc194803c6cc31f7c610972806fd4
docker exec registry bin/registry garbage-collect --dry-run /etc/docker/registry/config.yml

root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ls -ltr
total 48
drwxr-xr-x 3 root root 4096 Feb 11 07:16 c5
drwxr-xr-x 3 root root 4096 Feb 11 07:16 d2
drwxr-xr-x 3 root root 4096 Feb 11 07:16 e0
drwxr-xr-x 3 root root 4096 Feb 11 07:16 a1
drwxr-xr-x 3 root root 4096 Feb 11 07:16 09
drwxr-xr-x 3 root root 4096 Feb 11 07:16 cd
drwxr-xr-x 3 root root 4096 Feb 11 07:21 4f
drwxr-xr-x 3 root root 4096 Feb 11 07:21 99
drwxr-xr-x 3 root root 4096 Feb 11 07:21 14
drwxr-xr-x 4 root root 4096 Feb 11 07:21 ff
drwxr-xr-x 3 root root 4096 Feb 11 07:21 8b
drwxr-xr-x 3 root root 4096 Feb 11 07:21 33
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# for i in `ls -1`;do ls -ltr $i;done
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 09798120c134df0f94baf1714aee5657c50762660615bff11135ff417e259438
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:21 14442e79d2cafbc0a01b624b844d9c428f2859771284cc73a1c5a810db6ebeda
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:21 33eee7b677acccc9d2130eb4f6c10032f2ddc194803c6cc31f7c610972806fd4
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:21 4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:21 8b162eee27943f1a459c43b85dbe758b76ea66ebfa7ef443209d2e42d6702553
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:21 996d86d873b22b76dc5c67b60f7cd850072a8d154707a6271ecd5a070aa5e120
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c
total 4
drwxr-xr-x 2 root root 4096 Feb 11 07:16 e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172
total 8
drwxr-xr-x 2 root root 4096 Feb 11 07:21 ff963e4ef5eaacc2bf39706b6ad9d639495d26687435db52023ae9c56226518c
drwxr-xr-x 2 root root 4096 Feb 11 07:21 fffd53603a30596ba31883c3b96cff2500508c39ba79825ee39d817521740873
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#

Koszi elore a segitseget.
Ardi

Hozzászólás megjelenítési lehetőségek

A választott hozzászólás megjelenítési mód a „Beállítás” gombbal rögzíthető.

Alternatív javaslatok:
- a teljes docker working dir kidobása (előtte docker stop, majd üres mappára docker run), így nulláról indulsz, de más image-eket is elveszthetsz
- áttérés sonatype nexus használatára, tud private docker registry -t szolgáltatni (tehát nem csak egy előtét proxy, hanem implementálja önállóan a cuccot), van hozzá kattintós felület, ahol kényelmesen kezelhetők (gondolom törölhetők) az image-ek

--
arch,ubuntu,windows,libreelec,omnirom,microg
zbook/elitebook/rpi3/motog4_athene

Sajnos csak ilyen komplex modon lehet belole torolni:
1. Lekered az image manifestjet:
curl -i -H'Accept: application/vnd.docker.distribution.manifest.v2+json' {{ registry }}/v2/{{ image_name }}/manifests/{{ image_tag }}
2. Grepeld ki a Docker-Content-Digest hash-t
3. Torles:
curl -sS -XDELETE -H'Accept: application/vnd.docker.distribution.manifest.v2+json' {{ registry }}/v2/{{ image_name }}/manifests/{{ Docker_Content_Digest }}
4. Registry konteneren belul:
/usr/bin/registry garbage-collect {{ registry_config_file }}

hmm, probalom az 1. sort, de vhogy nem mukodik. megkapom a sha256 szamokat, de miert kapok manifest unknown-t?

vagy tan jo a lekerdezes eredmenye es mehet a 2. parancs?

root@dxxx:/# curl -i -H'Accept: application/vnd.docker.distribution.manifest.v2+json' http://xx.xx.xx.xx:5001/v2/ubuntu/manifests/18.10
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Mon, 11 Feb 2019 13:48:16 GMT
Content-Length: 182

{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown","detail":{"Name":"ubuntu","Revision":"sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637"}}]}
root@xxx:/#

root@xxx:/# curl -i -H'Accept: application/vnd.docker.distribution.manifest.v2+json' http://xx.xx.xx.xx:5001/v2/registry/manifests/2.4.0
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Mon, 11 Feb 2019 13:49:35 GMT
Content-Length: 184

{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown","detail":{"Name":"registry","Revision":"sha256:33eee7b677acccc9d2130eb4f6c10032f2ddc194803c6cc31f7c610972806fd4"}}]}
root@xxx:/#

Ardi

UPDATE: mindjart visszaterek, mert en mar toroltem a fajlokat.
Ardi

Probalva ujra:

1. Lekered az image manifestjet:
curl -i -H'Accept: application/vnd.docker.distribution.manifest.v2+json' {{ registry }}/v2/{{ image_name }}/manifests/{{ image_tag }}
2. Grepeld ki a Docker-Content-Digest hash-t
3. Torles:
curl -sS -XDELETE -H'Accept: application/vnd.docker.distribution.manifest.v2+json' {{ registry }}/v2/{{ image_name }}/manifests/{{ Docker_Content_Digest }}
4. Registry konteneren belul:
/usr/bin/registry garbage-collect {{ registry_config_file }}

Eredmeny:
az 1. parancs OK, de a 3. parancsnal hibat kapok: (lasd alabb)

1.
root@xxx:~# curl -i -H'Accept: application/vnd.docker.distribution.manifest.v2+json' http://xx.xx.xx.xx:5001/v2/ubuntu/manifests/18.10
HTTP/1.1 200 OK
Content-Length: 1150
Content-Type: application/vnd.docker.distribution.manifest.v2+json
Docker-Content-Digest: sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637"
X-Content-Type-Options: nosniff
Date: Mon, 11 Feb 2019 14:06:03 GMT

{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 3402,
"digest": "sha256:09798120c134df0f94baf1714aee5657c50762660615bff11135ff417e259438"
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 29269866,
"digest": "sha256:a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 862,
"digest": "sha256:e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 214,
"digest": "sha256:c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 163,
"digest": "sha256:d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c"
}
]
}root@xxx:~#

2.
Docker-Content-Digest: sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637

3.
root@xxx:~# curl -sS -XDELETE -H'Accept: application/vnd.docker.distribution.manifest.v2+json' http://xx.xx.xx.xx:5001/v2/ubuntu/manifests/cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
root@xxx:~#

ja, es nem letezik:

4. Registry konteneren belul:
/usr/bin/registry garbage-collect {{ registry_config_file }}

En ugy latom, hogy mi nem vagjuk le az "sha256:"-ot az elejerol. Probald ki ugy.

nem segitett:

root@xxx:~# curl -sS -XDELETE -H'Accept: application/vnd.docker.distribution.manifest.v2+json' http://xx.xx.xx.xx:5001/v2/ubuntu/manifests/sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
root@xxx:~#

Sub


Sic Transit Gloria Mundi

Ez fórumba való bejegyzés.

bocsesz - csak most jottem ra, hogy teljesen mashova irok...

Meglehetősen sokat szívtam ezzel, így álljon itt egy rövidke kis gyűjtemény arról mire jutottam:
- Használj registry_cli-t: https://github.com/andrey-pohilko/registry-cli
- A docker registry-det upgrade-eld fel min 2.7.0-ra (ha még nincs azon a szinten) és használd a -m kapcsolót. Ellenkezdő esetben a garbage collection-el szívni fogsz: https://github.com/docker/distribution/issues/1844
- Nem csak a remote registry-ből kell majd pucolni, hanem a build hoston is, mert ott meg unreferenced layerek jöhetnek létre.. Megoldás: gitlab.com/gitlab-org/docker-distribution-pruner
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

megprobalom, koszi az infot.
Mar tegnap nezegettem es elmentettem alternativakent. :-)
Ardi

Helloka,

jatszottam picit az anoxis/registry-cli-vel:

Beallitottam, hogy adott imagebol tartsa az utolso 3 peldanyt.
mint lathato, az ubuntu:14.04 torlesre kerul:

root@xxx:~# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --delete --num 3
Will delete all but 3 last tags
---------------------------------
Image: anoxis/registry-cli
tag: latest
Getting digests for tags to keep:
Getting digest for tag latest
Keep digest sha256:81c0a1032f0ad35103649d2fd1983ede46688f9509f108108eca8525c1b56c0c for tag latest
---------------------------------
Image: registry
tag: 2.7.0
Getting digests for tags to keep:
Getting digest for tag 2.7.0
Keep digest sha256:d6df97c93a0b8db7b355e08d54fbf38e46667eaa251cd5a90ddf0e53c35375b1 for tag 2.7.0
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 14.04
tag: 16.10
Getting digests for tags to keep:
Getting digest for tag 16.04
Keep digest sha256:63c8116d4105517e0776ec77997a213fcadcd49fb18e36e0e39e1df49736a2ab for tag 16.04
Getting digest for tag 18.10
Keep digest sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637 for tag 18.10
Getting digest for tag 16.10
Keep digest sha256:b4f01bb6621b74c03ba65601ba627f450a02e3284051dff73ee1bbaf164b45e8 for tag 16.10
deleting tag 14.04
done
root@xxx:~#

Listazom a megmaradt ubuntu image-ket:

root@xxx:~#
root@xxx:~# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 -i ubuntu
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 16.10
root@xxx:~#

Itt megprobalom felloni ujbol a 14.04 verziot, de ezt a hibat kapom:

root@xxx:~# docker push xx.xx.xx.xx:5001/ubuntu:14.04
The push refers to repository [xx.xx.xx.xx:5001/ubuntu]
40f4c1f68b37: Layer already exists
8f9b85d7bbd3: Layer already exists
d1b9ba926eff: Layer already exists
e8769e218081: Layer already exists
14.04: digest: sha256:17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e size: 1152
root@xxx:~#

root@xxx:~# docker exec -i -t registry /bin/registry garbage-collect /etc/docker/registry/config.yml -m
anoxis/registry-cli
anoxis/registry-cli: marking manifest sha256:81c0a1032f0ad35103649d2fd1983ede46688f9509f108108eca8525c1b56c0c
anoxis/registry-cli: marking blob sha256:176eed126cd91921633fc5cdd5cc79fd68173407acf7dc9850f5842e0f6117fe
anoxis/registry-cli: marking blob sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3
anoxis/registry-cli: marking blob sha256:30f71ecab593838ddd87500436d38a28548b4fe92df0368432f4851e86a9b197
anoxis/registry-cli: marking blob sha256:ed606575a8358d44aa4cf01c1d8361e6215f24e02c87700dc8795f4792fc65b8
anoxis/registry-cli: marking blob sha256:9c862b3c365fd4f719586635fb04291668ee2cb49f80390cea26eb8b3ec923e0
anoxis/registry-cli: marking blob sha256:a5d19d2aeea464fe1b6f40d981733e101929eb7d4e487bb7094cd15ef0401643
anoxis/registry-cli: marking blob sha256:f0992049d5e93969dab0086d1ad7345f555eac666e548684f4ce510b757a4801
anoxis/registry-cli: marking blob sha256:1c2c00c37f619b05a158ba5c6cd35fea8cec48fe8f3c75602c47ab78a131ba69
registry
registry: marking manifest sha256:d6df97c93a0b8db7b355e08d54fbf38e46667eaa251cd5a90ddf0e53c35375b1
registry: marking blob sha256:33fbbf4a24e52aca096ac8161eeb6963d61e734c48131ea491cf10aa32de9aae
registry: marking blob sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3
registry: marking blob sha256:0ecb9b11388e6647816c02447f3a63bdec0250928a103cf7bd8420e79f4b6643
registry: marking blob sha256:918b3ddb961319c4b9e6e8b5af1e9815e028e6a2844435afad97e7d5df9e3fff
registry: marking blob sha256:5aa847785533d4eab2abf866859152ae38f13fa47390cafad57d4d95b73d7c94
registry: marking blob sha256:adee6f5462691f6b6b70449069b3e2905d1170ef6673d8d749956bafeadba36d
ubuntu
ubuntu: marking manifest sha256:17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e
ubuntu: marking blob sha256:5dbc3f318ea50ea06fca865425e7d2b47fa2baa6094d3cb3760a1721f828a0ae
ubuntu: marking blob sha256:e53f134edff2c9a6928199bfbd8d0e70c1ecfcb4b5b70462028062f567a528f7
ubuntu: marking blob sha256:efbbd466a715ba1ee85664ed1e1fe53c3cb54759225eef1869a9b27179ea675f
ubuntu: marking blob sha256:e11368b8e0c73f08ef1deb948c24a8cfd2307a8eb138a0caf77bdfe4a4722d99
ubuntu: marking blob sha256:7dab2de7692bef415de0b332748c99d8949a7768add945030191c72a42e80511
ubuntu: marking manifest sha256:63c8116d4105517e0776ec77997a213fcadcd49fb18e36e0e39e1df49736a2ab
ubuntu: marking blob sha256:7e87e2b3bf7a84571ecc2a8cea8a81fabb63b2dde8e7fc559bcbee28d8e9be83
ubuntu: marking blob sha256:7b722c1070cdf5188f1f9e43b8413157f8dfb2b4fe84db3c03cb492379a42fcc
ubuntu: marking blob sha256:5fbf74db61f1459176d8647ba8f53f8e6cf933a2e56f73f0e8da81213117b7e9
ubuntu: marking blob sha256:ed41cb72e5c918bdbd78e68f02930a3f1cf1d6079402b0a5b19de8508e67b766
ubuntu: marking blob sha256:7ea47a67709ebea8efed59fbda703dbd00a0d2cae7e2808959744bfa30bfc0e9
ubuntu: marking manifest sha256:b4f01bb6621b74c03ba65601ba627f450a02e3284051dff73ee1bbaf164b45e8
ubuntu: marking blob sha256:7d3f705d307c7c225398e04d4c4f8512f64eb8a65959a1fb4514dfde18a047e7
ubuntu: marking blob sha256:4b8803acf1951239ecdc8839bf1c23aed744f291919a935741cf532d6f16e915
ubuntu: marking blob sha256:9c46748e16b2aceb5cdc8d5850a3ebbe08621c21a60f6805f5c54b428fb98aff
ubuntu: marking blob sha256:3b0ea830cf12c9ec6c968b643e893063cb37f461ac4ebde404812d8dba82e4be
ubuntu: marking blob sha256:7b3d450c41c718c1febdf1111fa03c3fdad9c59eb0cc1876a74ceee1e6c0840f
ubuntu: marking blob sha256:27b01083147a706f07fe50be5058b10dfd919ea28ba8ed4e2004d3308fa93684
ubuntu: marking manifest sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
ubuntu: marking blob sha256:09798120c134df0f94baf1714aee5657c50762660615bff11135ff417e259438
ubuntu: marking blob sha256:a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb
ubuntu: marking blob sha256:e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172
ubuntu: marking blob sha256:c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b
ubuntu: marking blob sha256:d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c

40 blobs marked, 0 blobs and 0 manifests eligible for deletion
root@xxx:~#
root@xxx:~#
root@xxx:~#

Eddig jutottam.
Ardi

Az ubuntu 14.04es image NEM kerül törlésre - akkor még nem: Azzal, hogy a registry-cli-t meghívod az imagek (illetve azok layerei) ténylegesen nem törlődnek, csupán az image tag megy a levesbe. A GC meg pont arra való, hogy az összes olyan layert amire egy tag se referál kidobja (itt történik meg ténylegesen a szabad hely felszabadítása).
Te viszont a GC futtatása előtt visszaraktad a 14.04es image-et (amelyekhez akkor még az összes layer helyben volt, szóval nem teljesen értem ezt miért tekinted hibának), és csak ez után futtattál GC-t (ami így viszont nem talált semmit amire ne lenne referencia).

Próbáld meg valahogy így:
docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --delete --num 3
docker exec registry /bin/registry garbage-collect -m /etc/docker/registry/config.yml
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

megcsinaltam:
root@xxx:~# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --delete --num 3
Will delete all but 3 last tags
---------------------------------
Image: anoxis/registry-cli
tag: latest
Getting digests for tags to keep:
Getting digest for tag latest
Keep digest sha256:81c0a1032f0ad35103649d2fd1983ede46688f9509f108108eca8525c1b56c0c for tag latest
---------------------------------
Image: registry
tag: 2.7.0
Getting digests for tags to keep:
Getting digest for tag 2.7.0
Keep digest sha256:d6df97c93a0b8db7b355e08d54fbf38e46667eaa251cd5a90ddf0e53c35375b1 for tag 2.7.0
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 14.04
tag: 16.10
Getting digests for tags to keep:
Getting digest for tag 16.04
Keep digest sha256:63c8116d4105517e0776ec77997a213fcadcd49fb18e36e0e39e1df49736a2ab for tag 16.04
Getting digest for tag 18.10
Keep digest sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637 for tag 18.10
Getting digest for tag 16.10
Keep digest sha256:b4f01bb6621b74c03ba65601ba627f450a02e3284051dff73ee1bbaf164b45e8 for tag 16.10
deleting tag 14.04
done
root@xxx:~#
root@xxx:~#
root@xxx:~#
root@xxx:~# cd /srv/registry/data/docker/registry/v2/blobs/
root@xxx:/srv/registry/data/docker/registry/v2/blobs# ls -ltr
total 4
drwxr-xr-x 35 root root 4096 Feb 12 08:27 sha256
root@xxx:/srv/registry/data/docker/registry/v2/blobs#
root@xxx:/srv/registry/data/docker/registry/v2/blobs# cd sha256/
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ls -ltr
total 132
drwxr-xr-x 3 root root 4096 Feb 12 08:25 d2
drwxr-xr-x 3 root root 4096 Feb 12 08:25 c5
drwxr-xr-x 3 root root 4096 Feb 12 08:25 e0
drwxr-xr-x 3 root root 4096 Feb 12 08:25 a1
drwxr-xr-x 3 root root 4096 Feb 12 08:25 09
drwxr-xr-x 3 root root 4096 Feb 12 08:25 3b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 27
drwxr-xr-x 3 root root 4096 Feb 12 08:25 4b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 b4
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5f
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7b
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 63
drwxr-xr-x 3 root root 4096 Feb 12 08:26 e1
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7d
drwxr-xr-x 3 root root 4096 Feb 12 08:26 ef
drwxr-xr-x 3 root root 4096 Feb 12 08:26 e5
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5d
drwxr-xr-x 3 root root 4096 Feb 12 08:26 ad
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5a
drwxr-xr-x 4 root root 4096 Feb 12 08:26 cd
drwxr-xr-x 3 root root 4096 Feb 12 08:26 0e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 91
drwxr-xr-x 3 root root 4096 Feb 12 08:26 33
drwxr-xr-x 3 root root 4096 Feb 12 08:26 d6
drwxr-xr-x 3 root root 4096 Feb 12 08:26 a5
drwxr-xr-x 3 root root 4096 Feb 12 08:26 1c
drwxr-xr-x 3 root root 4096 Feb 12 08:26 30
drwxr-xr-x 3 root root 4096 Feb 12 08:26 f0
drwxr-xr-x 4 root root 4096 Feb 12 08:26 9c
drwxr-xr-x 4 root root 4096 Feb 12 08:27 ed
drwxr-xr-x 4 root root 4096 Feb 12 08:27 17
drwxr-xr-x 3 root root 4096 Feb 12 08:27 81
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker exec registry /bin/registry garbage-collect -m /etc/docker/registry/config.yml
anoxis/registry-cli
anoxis/registry-cli: marking manifest sha256:81c0a1032f0ad35103649d2fd1983ede46688f9509f108108eca8525c1b56c0c
anoxis/registry-cli: marking blob sha256:176eed126cd91921633fc5cdd5cc79fd68173407acf7dc9850f5842e0f6117fe
anoxis/registry-cli: marking blob sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3
anoxis/registry-cli: marking blob sha256:30f71ecab593838ddd87500436d38a28548b4fe92df0368432f4851e86a9b197
anoxis/registry-cli: marking blob sha256:ed606575a8358d44aa4cf01c1d8361e6215f24e02c87700dc8795f4792fc65b8
anoxis/registry-cli: marking blob sha256:9c862b3c365fd4f719586635fb04291668ee2cb49f80390cea26eb8b3ec923e0
anoxis/registry-cli: marking blob sha256:a5d19d2aeea464fe1b6f40d981733e101929eb7d4e487bb7094cd15ef0401643
anoxis/registry-cli: marking blob sha256:f0992049d5e93969dab0086d1ad7345f555eac666e548684f4ce510b757a4801
anoxis/registry-cli: marking blob sha256:1c2c00c37f619b05a158ba5c6cd35fea8cec48fe8f3c75602c47ab78a131ba69
registry
registry: marking manifest sha256:d6df97c93a0b8db7b355e08d54fbf38e46667eaa251cd5a90ddf0e53c35375b1
registry: marking blob sha256:33fbbf4a24e52aca096ac8161eeb6963d61e734c48131ea491cf10aa32de9aae
registry: marking blob sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3
registry: marking blob sha256:0ecb9b11388e6647816c02447f3a63bdec0250928a103cf7bd8420e79f4b6643
registry: marking blob sha256:918b3ddb961319c4b9e6e8b5af1e9815e028e6a2844435afad97e7d5df9e3fff
registry: marking blob sha256:5aa847785533d4eab2abf866859152ae38f13fa47390cafad57d4d95b73d7c94
registry: marking blob sha256:adee6f5462691f6b6b70449069b3e2905d1170ef6673d8d749956bafeadba36d
ubuntu
ubuntu: marking manifest sha256:63c8116d4105517e0776ec77997a213fcadcd49fb18e36e0e39e1df49736a2ab
ubuntu: marking blob sha256:7e87e2b3bf7a84571ecc2a8cea8a81fabb63b2dde8e7fc559bcbee28d8e9be83
ubuntu: marking blob sha256:7b722c1070cdf5188f1f9e43b8413157f8dfb2b4fe84db3c03cb492379a42fcc
ubuntu: marking blob sha256:5fbf74db61f1459176d8647ba8f53f8e6cf933a2e56f73f0e8da81213117b7e9
ubuntu: marking blob sha256:ed41cb72e5c918bdbd78e68f02930a3f1cf1d6079402b0a5b19de8508e67b766
ubuntu: marking blob sha256:7ea47a67709ebea8efed59fbda703dbd00a0d2cae7e2808959744bfa30bfc0e9
ubuntu: marking manifest sha256:b4f01bb6621b74c03ba65601ba627f450a02e3284051dff73ee1bbaf164b45e8
ubuntu: marking blob sha256:7d3f705d307c7c225398e04d4c4f8512f64eb8a65959a1fb4514dfde18a047e7
ubuntu: marking blob sha256:4b8803acf1951239ecdc8839bf1c23aed744f291919a935741cf532d6f16e915
ubuntu: marking blob sha256:9c46748e16b2aceb5cdc8d5850a3ebbe08621c21a60f6805f5c54b428fb98aff
ubuntu: marking blob sha256:3b0ea830cf12c9ec6c968b643e893063cb37f461ac4ebde404812d8dba82e4be
ubuntu: marking blob sha256:7b3d450c41c718c1febdf1111fa03c3fdad9c59eb0cc1876a74ceee1e6c0840f
ubuntu: marking blob sha256:27b01083147a706f07fe50be5058b10dfd919ea28ba8ed4e2004d3308fa93684
ubuntu: marking manifest sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637
ubuntu: marking blob sha256:09798120c134df0f94baf1714aee5657c50762660615bff11135ff417e259438
ubuntu: marking blob sha256:a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb
ubuntu: marking blob sha256:e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172
ubuntu: marking blob sha256:c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b
ubuntu: marking blob sha256:d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c

34 blobs marked, 6 blobs and 0 manifests eligible for deletion
blob eligible for deletion: sha256:17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e
time="2019-02-12T08:30:49.790676854Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/17/17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
blob eligible for deletion: sha256:5dbc3f318ea50ea06fca865425e7d2b47fa2baa6094d3cb3760a1721f828a0ae
time="2019-02-12T08:30:49.791670268Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/5d/5dbc3f318ea50ea06fca865425e7d2b47fa2baa6094d3cb3760a1721f828a0ae" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
blob eligible for deletion: sha256:7dab2de7692bef415de0b332748c99d8949a7768add945030191c72a42e80511
time="2019-02-12T08:30:49.792595449Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/7d/7dab2de7692bef415de0b332748c99d8949a7768add945030191c72a42e80511" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
blob eligible for deletion: sha256:e11368b8e0c73f08ef1deb948c24a8cfd2307a8eb138a0caf77bdfe4a4722d99
time="2019-02-12T08:30:49.79341589Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/e1/e11368b8e0c73f08ef1deb948c24a8cfd2307a8eb138a0caf77bdfe4a4722d99" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
blob eligible for deletion: sha256:e53f134edff2c9a6928199bfbd8d0e70c1ecfcb4b5b70462028062f567a528f7
time="2019-02-12T08:30:49.794286593Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/e5/e53f134edff2c9a6928199bfbd8d0e70c1ecfcb4b5b70462028062f567a528f7" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
blob eligible for deletion: sha256:efbbd466a715ba1ee85664ed1e1fe53c3cb54759225eef1869a9b27179ea675f
time="2019-02-12T08:30:49.807618583Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/ef/efbbd466a715ba1ee85664ed1e1fe53c3cb54759225eef1869a9b27179ea675f" go.version=go1.11.2 instance.id=554fe2dc-0aa7-4c05-ace7-374e24c2a1fd service=registry
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ntpq
ntpq> q
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ls -ltr
total 132
drwxr-xr-x 3 root root 4096 Feb 12 08:25 d2
drwxr-xr-x 3 root root 4096 Feb 12 08:25 c5
drwxr-xr-x 3 root root 4096 Feb 12 08:25 e0
drwxr-xr-x 3 root root 4096 Feb 12 08:25 a1
drwxr-xr-x 3 root root 4096 Feb 12 08:25 09
drwxr-xr-x 3 root root 4096 Feb 12 08:25 3b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 27
drwxr-xr-x 3 root root 4096 Feb 12 08:25 4b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 b4
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5f
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7b
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 63
drwxr-xr-x 3 root root 4096 Feb 12 08:26 ad
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5a
drwxr-xr-x 4 root root 4096 Feb 12 08:26 cd
drwxr-xr-x 3 root root 4096 Feb 12 08:26 0e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 91
drwxr-xr-x 3 root root 4096 Feb 12 08:26 33
drwxr-xr-x 3 root root 4096 Feb 12 08:26 d6
drwxr-xr-x 3 root root 4096 Feb 12 08:26 a5
drwxr-xr-x 3 root root 4096 Feb 12 08:26 1c
drwxr-xr-x 3 root root 4096 Feb 12 08:26 30
drwxr-xr-x 3 root root 4096 Feb 12 08:26 f0
drwxr-xr-x 4 root root 4096 Feb 12 08:26 9c
drwxr-xr-x 4 root root 4096 Feb 12 08:27 ed
drwxr-xr-x 3 root root 4096 Feb 12 08:27 81
drwxr-xr-x 2 root root 4096 Feb 12 08:30 e1
drwxr-xr-x 3 root root 4096 Feb 12 08:30 7d
drwxr-xr-x 2 root root 4096 Feb 12 08:30 5d
drwxr-xr-x 3 root root 4096 Feb 12 08:30 17
drwxr-xr-x 2 root root 4096 Feb 12 08:30 ef
drwxr-xr-x 2 root root 4096 Feb 12 08:30 e5
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ntpq
ntpq> q
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#

viszont ahogy nezem, a blobs/sha256 konyvtarbol nem torlodott semmi.

Ha most ujbol fellonem az ubuntu:14.04-et, ismet hibat kapok?

Ardi

Ne a mappa struktúrát nézd, hanem akkor már a kihasznált helyet (du -sm) - az garantáltan változni fog.
A "Layer already exists" üzenetet én nem tekintem hibának, az csupán arról tájékoztat, hogy az adott layer már elérhető local cache-ben.
De kérdésedre válaszolva: Ha most pull-olnád ismét a 14.04es image-et, akkor ismét le kéne töltenie azt a Dockernek (és nem kapnál "Layer already exists" üzenetet)
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

a)
Hmm, ok, mondjuk, hogy a "Layer already exists" nem hiba.

b)
bocsi, de en most:

docker push xx.xx.xx.xx:5001/ubuntu:14.04

parancsra gondoltam, amely ujonnan fellone a privat registry-be az ujonnan taggolt ubuntu:14.04-et.
Megjegyzes: most nincs torolve:

docker images|grep 14.04
xx.xx.xx.xx:5001/ubuntu 14.04 5dbc3f318ea5 2 weeks ago 188MB
ubuntu 14.04 5dbc3f318ea5 2 weeks ago 188MB

Engem az zavar, hogy ha ujra fellovom a privat registry-be xx.xx.xx.xx:5001/ubuntu:14.04-et (miutan lokalisan toroltem), akkor a fellovesnel (push) nem jelez hibat, lehuzasnal (pull) a privat registry-bol hibat kapok (lasd a bejegyzes aljan):

root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 -i ubuntu
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 16.10
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --layers
---------------------------------
Image: anoxis/registry-cli
tag: latest
layer: sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3, size: 2207025
layer: sha256:30f71ecab593838ddd87500436d38a28548b4fe92df0368432f4851e86a9b197, size: 309123
layer: sha256:ed606575a8358d44aa4cf01c1d8361e6215f24e02c87700dc8795f4792fc65b8, size: 17574799
layer: sha256:9c862b3c365fd4f719586635fb04291668ee2cb49f80390cea26eb8b3ec923e0, size: 1779972
layer: sha256:a5d19d2aeea464fe1b6f40d981733e101929eb7d4e487bb7094cd15ef0401643, size: 190
layer: sha256:f0992049d5e93969dab0086d1ad7345f555eac666e548684f4ce510b757a4801, size: 3839620
layer: sha256:1c2c00c37f619b05a158ba5c6cd35fea8cec48fe8f3c75602c47ab78a131ba69, size: 6639
---------------------------------
Image: registry
tag: 2.7.0
layer: sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3, size: 2207025
layer: sha256:0ecb9b11388e6647816c02447f3a63bdec0250928a103cf7bd8420e79f4b6643, size: 626518
layer: sha256:918b3ddb961319c4b9e6e8b5af1e9815e028e6a2844435afad97e7d5df9e3fff, size: 6292930
layer: sha256:5aa847785533d4eab2abf866859152ae38f13fa47390cafad57d4d95b73d7c94, size: 373
layer: sha256:adee6f5462691f6b6b70449069b3e2905d1170ef6673d8d749956bafeadba36d, size: 213
---------------------------------
Image: ubuntu
tag: 16.04
layer: sha256:7b722c1070cdf5188f1f9e43b8413157f8dfb2b4fe84db3c03cb492379a42fcc, size: 43521448
layer: sha256:5fbf74db61f1459176d8647ba8f53f8e6cf933a2e56f73f0e8da81213117b7e9, size: 847
layer: sha256:ed41cb72e5c918bdbd78e68f02930a3f1cf1d6079402b0a5b19de8508e67b766, size: 526
layer: sha256:7ea47a67709ebea8efed59fbda703dbd00a0d2cae7e2808959744bfa30bfc0e9, size: 168
tag: 18.10
layer: sha256:a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb, size: 29269866
layer: sha256:e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172, size: 862
layer: sha256:c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b, size: 214
layer: sha256:d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c, size: 163
tag: 16.10
layer: sha256:4b8803acf1951239ecdc8839bf1c23aed744f291919a935741cf532d6f16e915, size: 42786408
layer: sha256:9c46748e16b2aceb5cdc8d5850a3ebbe08621c21a60f6805f5c54b428fb98aff, size: 816
layer: sha256:3b0ea830cf12c9ec6c968b643e893063cb37f461ac4ebde404812d8dba82e4be, size: 515
layer: sha256:7b3d450c41c718c1febdf1111fa03c3fdad9c59eb0cc1876a74ceee1e6c0840f, size: 854
layer: sha256:27b01083147a706f07fe50be5058b10dfd919ea28ba8ed4e2004d3308fa93684, size: 163
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#

Itt fellottem ujra:

root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker push xx.xx.xx.xx:5001/ubuntu:14.04
The push refers to repository [xx.xx.xx.xx:5001/ubuntu]
40f4c1f68b37: Layer already exists
8f9b85d7bbd3: Layer already exists
d1b9ba926eff: Layer already exists
e8769e218081: Layer already exists
14.04: digest: sha256:17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e size: 1152
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 -i ubuntu
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 14.04
tag: 16.10
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --layers
---------------------------------
Image: anoxis/registry-cli
tag: latest
layer: sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3, size: 2207025
layer: sha256:30f71ecab593838ddd87500436d38a28548b4fe92df0368432f4851e86a9b197, size: 309123
layer: sha256:ed606575a8358d44aa4cf01c1d8361e6215f24e02c87700dc8795f4792fc65b8, size: 17574799
layer: sha256:9c862b3c365fd4f719586635fb04291668ee2cb49f80390cea26eb8b3ec923e0, size: 1779972
layer: sha256:a5d19d2aeea464fe1b6f40d981733e101929eb7d4e487bb7094cd15ef0401643, size: 190
layer: sha256:f0992049d5e93969dab0086d1ad7345f555eac666e548684f4ce510b757a4801, size: 3839620
layer: sha256:1c2c00c37f619b05a158ba5c6cd35fea8cec48fe8f3c75602c47ab78a131ba69, size: 6639
---------------------------------
Image: registry
tag: 2.7.0
layer: sha256:cd784148e3483c2c86c50a48e535302ab0288bebd587accf40b714fffd0646b3, size: 2207025
layer: sha256:0ecb9b11388e6647816c02447f3a63bdec0250928a103cf7bd8420e79f4b6643, size: 626518
layer: sha256:918b3ddb961319c4b9e6e8b5af1e9815e028e6a2844435afad97e7d5df9e3fff, size: 6292930
layer: sha256:5aa847785533d4eab2abf866859152ae38f13fa47390cafad57d4d95b73d7c94, size: 373
layer: sha256:adee6f5462691f6b6b70449069b3e2905d1170ef6673d8d749956bafeadba36d, size: 213
---------------------------------
Image: ubuntu
tag: 16.04
layer: sha256:7b722c1070cdf5188f1f9e43b8413157f8dfb2b4fe84db3c03cb492379a42fcc, size: 43521448
layer: sha256:5fbf74db61f1459176d8647ba8f53f8e6cf933a2e56f73f0e8da81213117b7e9, size: 847
layer: sha256:ed41cb72e5c918bdbd78e68f02930a3f1cf1d6079402b0a5b19de8508e67b766, size: 526
layer: sha256:7ea47a67709ebea8efed59fbda703dbd00a0d2cae7e2808959744bfa30bfc0e9, size: 168
tag: 18.10
layer: sha256:a138b85795ddb9bf319d1eb360af4ae2a107c3624533f2469756781c4b96b2eb, size: 29269866
layer: sha256:e03f26254a3512bb6ad17698533a45f5cdeaced032b17205e0955763a8184172, size: 862
layer: sha256:c574f2a0d5fc60acda8ff09fd5e3eb34e1354802f0806f8ae17d2bd2c991772b, size: 214
layer: sha256:d214b3691158cb216fecf74099639861395c962a63a458fec1ad422d25afcf7c, size: 163
tag: 14.04
error 404
tag: 16.10
layer: sha256:4b8803acf1951239ecdc8839bf1c23aed744f291919a935741cf532d6f16e915, size: 42786408
layer: sha256:9c46748e16b2aceb5cdc8d5850a3ebbe08621c21a60f6805f5c54b428fb98aff, size: 816
layer: sha256:3b0ea830cf12c9ec6c968b643e893063cb37f461ac4ebde404812d8dba82e4be, size: 515
layer: sha256:7b3d450c41c718c1febdf1111fa03c3fdad9c59eb0cc1876a74ceee1e6c0840f, size: 854
layer: sha256:27b01083147a706f07fe50be5058b10dfd919ea28ba8ed4e2004d3308fa93684, size: 163
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# ls -ltr
total 132
drwxr-xr-x 3 root root 4096 Feb 12 08:25 d2
drwxr-xr-x 3 root root 4096 Feb 12 08:25 c5
drwxr-xr-x 3 root root 4096 Feb 12 08:25 e0
drwxr-xr-x 3 root root 4096 Feb 12 08:25 a1
drwxr-xr-x 3 root root 4096 Feb 12 08:25 09
drwxr-xr-x 3 root root 4096 Feb 12 08:25 3b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 27
drwxr-xr-x 3 root root 4096 Feb 12 08:25 4b
drwxr-xr-x 3 root root 4096 Feb 12 08:25 b4
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5f
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7b
drwxr-xr-x 4 root root 4096 Feb 12 08:26 7e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 63
drwxr-xr-x 3 root root 4096 Feb 12 08:26 ad
drwxr-xr-x 3 root root 4096 Feb 12 08:26 5a
drwxr-xr-x 4 root root 4096 Feb 12 08:26 cd
drwxr-xr-x 3 root root 4096 Feb 12 08:26 0e
drwxr-xr-x 3 root root 4096 Feb 12 08:26 91
drwxr-xr-x 3 root root 4096 Feb 12 08:26 33
drwxr-xr-x 3 root root 4096 Feb 12 08:26 d6
drwxr-xr-x 3 root root 4096 Feb 12 08:26 a5
drwxr-xr-x 3 root root 4096 Feb 12 08:26 1c
drwxr-xr-x 3 root root 4096 Feb 12 08:26 30
drwxr-xr-x 3 root root 4096 Feb 12 08:26 f0
drwxr-xr-x 4 root root 4096 Feb 12 08:26 9c
drwxr-xr-x 4 root root 4096 Feb 12 08:27 ed
drwxr-xr-x 3 root root 4096 Feb 12 08:27 81
drwxr-xr-x 2 root root 4096 Feb 12 08:30 e1
drwxr-xr-x 3 root root 4096 Feb 12 08:30 7d
drwxr-xr-x 2 root root 4096 Feb 12 08:30 5d
drwxr-xr-x 3 root root 4096 Feb 12 08:30 17
drwxr-xr-x 2 root root 4096 Feb 12 08:30 ef
drwxr-xr-x 2 root root 4096 Feb 12 08:30 e5
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker images|grep 14.04
ubuntu 14.04 5dbc3f318ea5 2 weeks ago 188MB
xx.xx.xx.xx:5001/ubuntu 14.04 5dbc3f318ea5 2 weeks ago 188MB
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker rmi xx.xx.xx.xx:5001/ubuntu:14.04
Untagged: xx.xx.xx.xx:5001/ubuntu:14.04
Untagged: xx.xx.xx.xx:5001/ubuntu@sha256:17f216e8eb523740f5f93a297faf6a6dcb393e14fa911168b4e9df3c0b6ef28e
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256# docker pull xx.xx.xx.xx:5001/ubuntu:14.04
Error response from daemon: manifest for xx.xx.xx.xx:5001/ubuntu:14.04 not found
root@xxx:/srv/registry/data/docker/registry/v2/blobs/sha256#

Ami meg meeg erdekes:

root@xxx:~# docker run --rm anoxis/registry-cli -r http://xx.xx.xx.xx:5001 --delete --num 3
Will delete all but 3 last tags
---------------------------------
Image: anoxis/registry-cli
tag: latest
Getting digests for tags to keep:
Getting digest for tag latest
Keep digest sha256:81c0a1032f0ad35103649d2fd1983ede46688f9509f108108eca8525c1b56c0c for tag latest
---------------------------------
Image: registry
tag: 2.7.0
Getting digests for tags to keep:
Getting digest for tag 2.7.0
Keep digest sha256:d6df97c93a0b8db7b355e08d54fbf38e46667eaa251cd5a90ddf0e53c35375b1 for tag 2.7.0
---------------------------------
Image: ubuntu
tag: 16.04
tag: 18.10
tag: 14.04
tag: 16.10
Getting digests for tags to keep:
Getting digest for tag 16.04
Keep digest sha256:63c8116d4105517e0776ec77997a213fcadcd49fb18e36e0e39e1df49736a2ab for tag 16.04
Getting digest for tag 18.10
Keep digest sha256:cd279abf5ab3ce4e0eaef6d98edbc91d5004513e2c5c8203cd31950bfc98b637 for tag 18.10
Getting digest for tag 16.10
Keep digest sha256:b4f01bb6621b74c03ba65601ba627f450a02e3284051dff73ee1bbaf164b45e8 for tag 16.10
deleting tag 14.04
tag digest not found: 404.
Try adding flag --digest-method=GET
root@xxx:~#

Ardi

Bocs, ezek szerint sikerült félreértselek.. És igen, ez tényleg hiba lesz, mivel a registry nem asszociálja a 14.04-hez tartozó layereket a registry-ben (rossz manifest?), a layerek külön-külön viszont mint ha még mindig fent lennének..
Anno ha jól rémlik ez nekem is szembe jött, és 2 megoldást találtam rá:
- Offline megoldás: Indítsd újra a registry-t, és utána próbálj meg pusholni: Ez után általában nekem menni szokott
- Online megoldás: Ahogy írtam fentebb használd a docker-distribution-pruner-t, csak a konfig file-jában a docker registry által használt file-okat add meg..

Nálam ez így néz ki:
# docker cp registry:/etc/docker/registry/config.yml /tmp/registry-config.yml
# VOLUME_PATH=$( docker inspect registry |awk -F "\"" '/Source/ && !/xml/ {print $4}')
# sed -iE "s/rootdirectory:.*/rootdirectory: $(echo "${VOLUME_PATH}"|sed -E "s/\//\\\\\\//g")/" /tmp/registry-config.yml
# docker-distribution-pruner -config=/tmp/registry-config.yml -parallel-repository-walk -parallel-blob-walk -soft-errors -delete -soft-delete=false

____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Heloka - szuper - koszike.

a)
Az Offline megoldás - kiprobalva. Muekodik.

b)
Az Online megoldasnal meeg keresem a megfelelo fajlokat.

A docker registry-t anno igy indotottam. Szoval nincs semmilyen registry-config.yml

docker run -d -p 5001:5000 --name registry -v /srv/registry/data:/var/lib/registry --env REGISTRY_STORAGE_DELETE_ENABLED='true' --restart always registry:2.7.0

https://github.com/wizbii/docker-distribution-pruner szerint:

usage:

You can simply docker run wizbii/distribution-pruner, but the pruner needs the distribution config file. To have access the config file you can docker run --volumes-from=your-registry-container wizbii/distribution-pruner -config /path/to/folder/of/you/registry/config.yml

es

Here is a miniaml config.yml example:

version: 0.1
storage:
filesystem:
rootdirectory: /registry

Letrehoztam ezt:

root@xxx:~# mkdir wizbii-distribution-pruner
root@xxx:~# cd wizbii-distribution-pruner/
root@xxx:~/wizbii-distribution-pruner# pwd
/root/wizbii-distribution-pruner
root@xxx:~/wizbii-distribution-pruner# vi config.yml
root@xxx:~/wizbii-distribution-pruner# cat config.yml
version: 0.1
storage:
filesystem:
rootdirectory: /var/lib/registry
root@xxx:~/wizbii-distribution-pruner#
root@xxx:~/wizbii-distribution-pruner# cat config.yml
version: 0.1
storage:
filesystem:
rootdirectory: /var/lib/registry
root@docking3:~/wizbii-distribution-pruner#
root@xxx:~/wizbii-distribution-pruner# docker run wizbii/distribution-pruner -config config.yml
FATA[0000] open config.yml: no such file or directory
root@xxx:~/wizbii-distribution-pruner#

de vhogy nem tudom mukodesre birni.

Parameterek nelkul:

root@xxx:~/wizbii-distribution-pruner# docker run wizbii/distribution-pruner
Usage of /docker-distribution-pruner:
-config string
Path to registry config file
-debug
Print debug messages
-delete
Delete data, instead of dry run
-delete-old-tag-versions
Delete old tag versions (default true)
-ignore-blobs
Ignore blobs processing and recycling
-jobs int
Number of concurrent jobs to execute (default 10)
-parallel-blob-walk
Allow to use parallel blob walker
-parallel-repository-walk
Allow to use parallel repository walker
-parallel-walk-jobs int
Number of concurrent parallel walk jobs to execute (default 10)
-repository-csv-output string
File to which CSV will be written with all metrics (default "repositories.csv")
-s3-storage-cache string
s3 cache (default "tmp-cache")
-soft-delete
When deleting, do not remove, but move to backup/ folder (default true)
-soft-errors
Print errors, but do not fail
-verbose
Print verbose messages (default true)
root@xxx:~/wizbii-distribution-pruner#

Ardi

Szerintem nem ugyan arról a prunerről beszélünk:
- Én a https://gitlab.com/gitlab-org/docker-distribution-pruner -osat használom (ha nincs meg, akkor 'go get -u gitlab.com/gitlab-org/docker-distribution-pruner') , annak adom át így a config file-t
- Te ránézésre ennek egy konténerizált verzióját használod, ott viszont a docker run-nak átadott config file-t a containeren belül próbálja majd megtalálni (ami persze nem lesz ott). Esetleg megpróbálkozhatsz azzal, hogy a registry volume folderjét, meg a config file-t is volume mountolod, de ez részemről innen csak tipp.

Amúgy emlékeim szerint (fixme) a registry image-ben by default ott van a /etc/docker/registry/config.yml, maximum default értékekkel. Nekem ezek nem jöttek be, így én a config file-t volume mountolom az alábbi módon:

docker run \
    -d \
    -p 5000:5000 \
    --restart=always \
    --name registry \
    -e REGISTRY_STORAGE_DELETE_ENABLED=true \
    -v /local/docker_registry:/var/lib/registry \
    -v /local/registry-config.xml:/etc/docker/registry/config.yml \
    registry:2.7

A jelenlegi config file-om meg így néz ki:

version: 0.1
log:
  accesslog:
    disabled: true
  level: warn
  formatter: text
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
  delete:
    enabled: true
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3

// Hátha ez segít..

____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Koszi szepen az update-et.
Letezik mas modja is ennek az altalad fenn emlitett gitlabos docker-distribution-pruner-nek a lehuzasara? ez a go parancs nekem nem mond semmit.
Ardi

Esetleg szedd le a master branchből frissen forgatott binárist:
https://gitlab.com/gitlab-org/docker-distribution-pruner/pipelines?scope=branches
# Artifacts gomb alatt a "Download binary artifacts" gomb

Side note: Hosszú távon viszont tutira jobban járnál, ha az a go parancs mondana is valamit, mert még sokszor jöhet szembe :) Esetleg próbálj meg kicsit birkózni vele :)
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

koszi szepen - lehuztam a binarist.

Parameter nelkul lefut, viszont parameterrel nem ugy, mint kene. :-)

root@xxx:/usr/local/sbin# EXPERIMENTAL=true docker-distribution-pruner
Usage of docker-distribution-pruner:
-config string
Path to registry config file
-debug
Print debug messages
-delete
Delete data, instead of dry run
-delete-old-tag-versions
Delete old tag versions (default true)
-ignore-blobs
Ignore blobs processing and recycling
-jobs int
Number of concurrent jobs to execute (default 10)
-parallel-blob-walk
Allow to use parallel blob walker
-parallel-repository-walk
Allow to use parallel repository walker
-parallel-walk-jobs int
Number of concurrent parallel walk jobs to execute (default 10)
-repository-csv-output string
File to which CSV will be written with all metrics (default "repositories.csv")
-s3-storage-cache string
s3 cache (default "tmp-cache")
-soft-delete
When deleting, do not remove, but move to backup/ folder (default true)
-soft-errors
Print errors, but do not fail
-verbose
Print verbose messages (default true)

root@xxx:/usr/local/sbin# EXPERIMENTAL=true docker-distribution-pruner -config=/srv/registry/registry-config.xml
INFO[0000] Walking BLOBS...
INFO[0000] BLOBS DIR: blobs
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x73be08]

goroutine 6 [running]:
gitlab.com/gitlab-org/docker-distribution-pruner/experimental.(*fsStorage).Walk.func1(0xc000016090, 0x2b, 0x0, 0x0, 0x880fa0, 0xc000352090, 0x20, 0x7b6280)
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/fs_storage.go:36 +0x58
path/filepath.Walk(0xc000016090, 0x2b, 0xc00000a0a0, 0x7fc675, 0x1)
/usr/local/go/src/path/filepath/path.go:402 +0x6a
gitlab.com/gitlab-org/docker-distribution-pruner/experimental.(*fsStorage).Walk(0xc000068418, 0xc000016090, 0x2b, 0xc000016120, 0x2b, 0xc000018090, 0x0, 0x0)
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/fs_storage.go:35 +0x1a1
gitlab.com/gitlab-org/docker-distribution-pruner/experimental.blobsData.walkPath(0xc0002dff20, 0x7fd2ce, 0x5, 0x0, 0x0)
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/blobs.go:102 +0x127
gitlab.com/gitlab-org/docker-distribution-pruner/experimental.blobsData.walk(0xc0002dff20, 0x817b00, 0xc000012080, 0x0)
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/blobs.go:123 +0x168
gitlab.com/gitlab-org/docker-distribution-pruner/experimental.Main.func3(0xc000012080, 0xc0002dff20)
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/main.go:106 +0x73
created by gitlab.com/gitlab-org/docker-distribution-pruner/experimental.Main
/go/src/gitlab.com/gitlab-org/docker-distribution-pruner/experimental/main.go:99 +0x2ca
root@xxx:/usr/local/sbin#

Megjegyzes: azt a go-t mrg majd megnezem - koszonom.

Ardi

A /srv/registry/registry-config.xml-nek mi a tartalma? Arra figyeltél, hogy a rootdirectory a Registry által használt DIR-re mutasson, amit helyből elérhet?
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Ezek a beallitasok:

root@xxx:/usr/local/sbin# cd /srv/registry/
root@xxx:/srv/registry# ls
data registry-config.xml
root@xxx:/srv/registry# cat registry-config.xml
version: 0.1
log:
accesslog:
disabled: true
level: warn
formatter: text
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
root@xxx:/srv/registry:

root@xxx:/srv/registry# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7cbaf5fafe94 registry:2.7.0 "/entrypoint.sh /etc…" About an hour ago Up About an hour 0.0.0.0:5001->5000/tcp registry
root@xxx:/srv/registry#

root@xxx:/srv/registry# docker exec -it 7cbaf5fafe94 cat /etc/docker/registry/config.yml
version: 0.1
log:
accesslog:
disabled: true
level: warn
formatter: text
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
root@xxx:/srv/registry#

Akkor utolsó kérdés: A registry-nek a /var/lib/registry-ja volume mountolt e a local gép /var/lib/registry alól?
Csak mert a registry belsőleg fogja a /var/lib/registry-t keresni, míg a docker-distribution-pruner a docker futtatókörnyezeten kívüli /var/lib/registry-t. Ha a 2 nem azonos (értsd: nincs egy -v /var/lib/registry:/var/lib/registry megadva a registry-nek), akkor utóbbi nem fog tudni miből dolgozni.
szerk: Ha meg nem volume mountolt, akkor külsőleg nem is fogod látni direktben azokat a file-okat trükközés nélkül..
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Hmm, szerintem lokalisan NEM letezik /var/lib/registry.

en a registry container-t igy futtatom:

docker run -d -p 5001:5000 --restart=always --name registry -e REGISTRY_STORAGE_DELETE_ENABLED=true -v /srv/registry/data:/var/lib/registry -v /srv/registry/registry-config.xml:/etc/docker/registry/config.yml registry:2.7.0

Megjegyzes: Most nem tudom, hogy kell-e a -e REGISTRY_STORAGE_DELETE_ENABLED=true parameter, ha
a /srv/registry/registry-config.xml fajl tartalmazza ugyanezt ezekben a sorokban:

storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true

A registry container-jeban levo /var/lib/registry lokalisan a /srv/registry/data-ra mutat, mig a registry container-jeben levo /etc/docker/registry/config.yml a lokalisan a /srv/registry/registry-config.xml fajlra.

root@xxx:/srv/registry# docker exec -it 7cbaf5fafe94 mount|grep registry
/dev/mapper/vg-lv_root on /var/lib/registry type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/mapper/vg-lv_root on /etc/docker/registry/config.yml type ext4 (rw,relatime,errors=remount-ro,data=ordered)
root@xxx:/srv/registry#

A fellovott disztrok itt talalhatok:

root@xxx:/srv/registry/data/docker/registry/v2/repositories# pwd
/srv/registry/data/docker/registry/v2/repositories

root@xxx:/srv/registry/data/docker/registry/v2/repositories# ls -ltr
total 12
drwxr-xr-x 5 root root 4096 Feb 12 13:31 ubuntu
drwxr-xr-x 3 root root 4096 Feb 12 13:39 anoxis
drwxr-xr-x 5 root root 4096 Feb 12 13:40 registry
root@xxx:/srv/registry/data/docker/registry/v2/repositories#

vagy nem jol csinalom?

Ardi

Igen, erre mondtam, hogy a docker-distribution-pruner-ben hivatkozott config file-ban a kívülről elérhető mappára kell mutasson (jelen esetben a /srv/registry/data-ra). Ha megnézed fentebb, akkor én ezt úgy oldottam meg, hogy a containerből kimásolom a configot, egy lokális temp file-ba, arra nyomok egy inline sed-et, hogy felülvágjam a rootdirectory-t, majd az így módosított config file-ra hívom meg a docker-distribution-pruner-t..

Idézet:
# docker cp registry:/etc/docker/registry/config.yml /tmp/registry-config.yml
# VOLUME_PATH=$( docker inspect registry |awk -F "\"" '/Source/ && !/xml/ {print $4}')
# sed -iE "s/rootdirectory:.*/rootdirectory: $(echo "${VOLUME_PATH}"|sed -E "s/\//\\\\\\//g")/" /tmp/registry-config.yml
# docker-distribution-pruner -config=/tmp/registry-config.yml -parallel-repository-walk -parallel-blob-walk -soft-errors -delete -soft-delete=false

____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

most mar ertem - bocsi a lassusagomert.
Vmit azonban nagyon megkutyultam, mert most meg allandoan restartolja a registry containert.
De ezzel mar eljatszogatok.
Jelentkezem, miutan helyreallitottam.
Es koszi a segitseget.

UPDATE: megis kernek segitseget - vhogy nem ertem a kulonbseget:
Miert kapok allandoan Restart-ot? hisz eddig mukodott.

###A)
root@xxx:/srv/registry# docker run -d -p 5001:5000 --name registry -v /srv/registry/data:/var/lib/registry --restart always registry:2.7.0
3821cc0ef7c486b0f75290a7eb3d70fcdb466a1a96bd7eb843f5a7fac4fd8c00
root@xxx:/srv/registry# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3821cc0ef7c4 registry:2.7.0 "/entrypoint.sh /etc…" 4 seconds ago Up 2 seconds 0.0.0.0:5001->5000/tcp registry
root@xxx:/srv/registry#
root@xxx:/srv/registry# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3821cc0ef7c4 registry:2.7.0 "/entrypoint.sh /etc…" 6 seconds ago Up 4 seconds 0.0.0.0:5001->5000/tcp registry
root@xxx:/srv/registry#
root@xxx:/srv/registry# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3821cc0ef7c4 registry:2.7.0 "/entrypoint.sh /etc…" 7 seconds ago Up 6 seconds 0.0.0.0:5001->5000/tcp registry
root@xxx:/srv/registry#
root@xxx:/srv/registry# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3821cc0ef7c4 registry:2.7.0 "/entrypoint.sh /etc…" 11 seconds ago Up 10 seconds 0.0.0.0:5001->5000/tcp registry
root@xxx:/srv/registry# docker container stop 3821cc0ef7c4
3821cc0ef7c4
root@xxx:/srv/registry# docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
3821cc0ef7c486b0f75290a7eb3d70fcdb466a1a96bd7eb843f5a7fac4fd8c00

Total reclaimed space: 0B
root@xxx:/srv/registry#
root@xxx:/srv/registry#

###B)
root@xxx:/srv/registry/data# docker run -d -p 5001:5000 --restart=always --name registry -e REGISTRY_STORAGE_DELETE_ENABLED=true -v /srv/registry/data:/var/lib/registry -v /srv/registry/registry-config.xml:/etc/docker/registry/config.yml registry:2.7.0
c3f46dcec159ef718587eb8b2a6f71569dcf1d0087882192476082e70bb4d671
root@xxx:/srv/registry/data#
root@xxx:/srv/registry/data# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3f46dcec159 registry:2.7.0 "/entrypoint.sh /etc…" 6 seconds ago Restarting (1) Less than a second ago registry
root@xxx:/srv/registry/data#
root@xxx:/srv/registry/data# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3f46dcec159 registry:2.7.0 "/entrypoint.sh /etc…" 11 seconds ago Restarting (1) 2 seconds ago registry
root@xxx:/srv/registry/data# docker container stop c3f46dcec159
c3f46dcec159
root@xxx:/srv/registry/data# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@xxx:/srv/registry/data#
root@xxx:/srv/registry/data#
root@xxx:/srv/registry/data# docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
c3f46dcec159ef718587eb8b2a6f71569dcf1d0087882192476082e70bb4d671

Total reclaimed space: 0B
root@xxx:/srv/registry/data# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@xxx:/srv/registry/data#

Ardi

OK - A,B megoldva.
a registry-config.xml strukturaja volt a hibas.
Mukodik most mar a B is.

es kiprobalva (most nem volt eddig benne adat) :-)

root@xxx:/usr/local/sbin# EXPERIMENTAL=true docker-distribution-pruner -config=/tmp/registry-config.yml -parallel-repository-walk -parallel-blob-walk -soft-errors -delete -soft-delete=false
INFO[0000] Walking BLOBS...
INFO[0000] Walking REPOSITORIES...
INFO[0000] Marking REPOSITORIES...
INFO[0000] Sweeping REPOSITORIES...
INFO[0000] Sweeping BLOBS...
INFO[0000] Summary...
INFO[0000] BLOBS INFO: Objects/Unused: 0 / 0 Data/Unused: 0 B / 0 B
WARN[0000] DELETEABLE INFO: 0 links, 0 blobs, 0 other, 0 B
root@xxx:/usr/local/sbin#

Ardi

Meeg egy utolso kerdes: ez a docker-distribution-pruner tenylegesen torol is vmit?
Ardi

Igen, bár csak akkor ha van unreferenced layer amit a GC nem talált meg.
Ilyen nálam akkor szokott előjönni, amikor van egy image-ed (X layer-el), amit aztán törölsz (untaggelsz, layerek maradnak), majd újra feltöltesz egy ugyan olyan nevű image-et, aminek a layerei között van némi különbség.. Registry GC ezeket néha nem találja meg (mivel a layer által eredetileg hivatkozott nevű manifest még ott van), és olyankor ezek hajlamosak ott is maradni.
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Hmm, en meg azt hittem, tetszolegesen torolhetek disztro es verzio szerint.
Akkor az anoxis/registry-cli nem jobb?
ott legalabb beallithato, hogy adott disztronal max hany verziot tartson meg.

Ardi

Nem.. A különböző toolok másra valóak:
- registry-cli arra van, hogy már nem kellő image-eket untaggelj
- A registry-ben lévő GC arra van, hogy az untaggelt manifestekhez tartozó layereket kidobálja, viszont ez némileg bugos (még 2.7.0 alatt is, pedig ott már elég sok mindent javítottak), így néha olyan layerek is ott maradnak a reigstry-ben, aminek amúgy már semmi keresnivalója
- A docker-distribution-pruner ezeket az unreferenced layereket képes megtalálni, és ténylegesen törölni
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

ertem es koszonom a magyarazatot.

talaltam meeg mellesleg egy erdekes docker image-et:

https://hub.docker.com/r/klausmeyer/docker-registry-browser/

ezzel web interfeszen keresztul lathatom es torolhetem a privat regiszterbe feltoltott image-eket.

el kene meeg jatszanom meg azzal, hogy biztonsagos legyen a hozzaferes.
mondjuk vmi felhasznaloval es jelszoval.
Ardi

Az már szerintem menni fog :) Ha nem menne, akkor dobj PM-et.
Amúgy megtaláltam, hogy anno miért kellett nekem a docker-distribution-pruner, de az eredeti kommentemet már nem tudom szerkeszteni, szóval álljon itt egy kis side note: https://github.com/docker/distribution/issues/2212
____________________________________
Az embert 2 éven át arra tanítják hogyan álljon meg a 2 lábán, és hogyan beszéljen... Aztán azt mondják neki: -"Ülj le és kuss legyen!"..

Ejj, ebből milyen szép fórumbejegyzés lehetett volna!

-----
„Egy jó kapcsolatban a társunkat az ő dolgában kell támogatni, nem a miénkben.”
rand() a lelke mindennek! :)
Szerinted…

sub