====== OCI Registry ======
===== Registry starten =====
Ohne TLS und Passwort sollte sie nicht öffentlich erreichbar gemacht werden. (( https://distribution.github.io/distribution/about/deploying/ ))
ip a s eth1
export PRIVATE_INTERFACE=eth1
echo 'export PRIVATE_INTERFACE=eth1' >> ~/.bashrc
export PRIVATE_IP4=$(/sbin/ip -o -4 addr list ${PRIVATE_INTERFACE} | awk '{print $4}' | cut -d/ -f1)
echo 'export PRIVATE_IP4=$(/sbin/ip -o -4 addr list ${PRIVATE_INTERFACE} | awk '{print $4}' | cut -d/ -f1)' >> ~/.bashrc
docker run -d \
-p $PRIVATE_IP4:5000:5000 \
--restart=always \
--name registry \
registry:3
===== dockerd für Registry konfigurieren =====
++++ Podman |
[[registry]]
location = "192.168.122.103:5000"
insecure = true
Prüfen:
podman info --format json | jq '.registries."192.168.122.103:5000"'
-> sollte die lokale Registry anzeigen
++++
{
…
"insecure-registries": […, "registry.notebook36.linuxhotel.de:5000"]
}
ip a s eth1
Bitte die PRIVATE IP eintragen...
{
…
"insecure-registries": […, "10.97.7.11:5000", "ingo-1.lxht.de:5000"]
}
systemctl restart docker.service
prüfen: (( Doku zu [[https://pkg.go.dev/text/template|GO templates]] ))
docker info --format '{{(index .RegistryConfig.IndexConfigs "registry.notebook36.linuxhotel.de:5000").Secure}}'
-> sollte ''false'' (=insecure) ausgeben
===== Image zu Registry übertragen =====
docker image tag ingo/debian:trixie registry.notebook36.linuxhotel.de:5000/ingo/debian:trixie
docker image push registry.notebook36.linuxhotel.de:5000/ingo/debian:trixie
Abfragen, ob das Image angekommen ist:
curl http://registry.notebook36.linuxhotel.de:5000/v2/_catalog
curl http://$PRIVATE_IP4:5000/v2/_catalog
docker manifest inspect --insecure $PRIVATE_IP4:5000/ingo/debian:trixie
curl -s \
http://$PRIVATE_IP4:5000/v2/ingo/debian/tags/list | jq
==== Reference Registry Tools =====
- [[https://github.com/oras-project/oras|ORAS]]
- [[https://github.com/podman-container-tools/skopeo|Skopeo]]
- [[https://github.com/regclient/regclient|Regclient]]
++++ Reg UI |
- [[https://github.com/Joxit/docker-registry-ui|docker-registry-ui]]
docker run -d -p 8080:80 --name reg-ui \
--env REGISTRY_URL=http://$PRIVATE_IP4:5000 \
joxit/docker-registry-ui:latest
++++