See also documentation about Podman and Docker
1# list index catalog
2curl https://registry.k3s.example.com/v2/_catalog | jq
3
4# List tags available regarding an image
5curl https://registry.k3s.example.com/v2/myhaproxy/tags/list
6
7# list index catalog - with user/password
8curl https://registry-admin:<PWD>@registry.k3s.example.com/v2/_catalog | jq
9
10# list index catalog - when you need to specify the CA
11curl -u user:password https://<url>:<port>/v2/_catalog --cacert ca.crt | jq
12
13# list index catalog - for OCP
14curl -u user:password https://<url>:<port>/v2/ocp4/openshift4/tags/list | jq
15
16# Login to registry with podman
17podman login -u registry-admin -p <PWD> registry.k3s.example.com
18
19# Push images in the registry
20skopeo copy "--dest-creds=registry-admin:<PWD>" docker://docker.io/goharbor/harbor-core:v2.6.1 docker://registry.k3s.example.com/goharbor/harbor-core:v2.6.1
1ip a
2sudo vi /etc/docker/daemon.json
1{
2"insecure-registries": ["192.168.1.11:5000"]
3}
1sudo systemctl restart docker
2docker info
Check docker config
Load the image
1podman pull sonatype/nexus3:3.59.0
2podman save sonatype/nexus3:3.59.0 -o nexus3.tar
3podman load < nexus3.tar
Create a service inside /etc/systemd/system/container-nexus3.service with content below:
1[Unit]
2Description=Nexus Podman container
3Wants=syslog.service
4
5[Service]
6User=nexus-system
7Group=nexus-system
8Restart=always
9ExecStart=/usr/bin/podman run \
10 --log-level=debug \
11 --rm \
12 -ti \
13 --publish 8081:8081 \
14 --name nexus \
15 sonatype/nexus3:3.59.0
16
17ExecStop=/usr/bin/podman stop -t 10 nexus
18
19[Install]
20WantedBy=multi-user.target
Nothing original, it just the documentation of redhat, but can be usefull to kickstart a registry.
Prerequisites:
1# packages
2sudo yum install -y podman
3sudo yum install -y rsync
4sudo yum install -y jq
5
6# Get tar
7mirror="https://mirror.openshift.com/pub/openshift-v4/clients"
8wget ${mirror}/mirror-registry/latest/mirror-registry.tar.gz
9tar zxvf mirror-registry.tar.gz
10
11# Get oc-mirror
12curl https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/oc-mirror.rhel9.tar.gz -O
13
14# Basic install
15sudo ./mirror-registry install \
16 --quayHostname quay01.example.local \
17 --quayRoot /opt
18
19# More detailed install
20sudo ./mirror-registry install \
21 --quayHostname quay01.example.local \
22 --quayRoot /srv \
23 --quayStorage /srv/quay-pg \
24 --pgStorage /srv/quay-storage \
25 --sslCert tls.crt \
26 --sslKey tls.key
27
28podman login -u init \
29 -p 7u2Dm68a1s3bQvz9twrh4Nel0i5EMXUB \
30 quay01.example.local:8443 \
31 --tls-verify=false
32
33# By default login go in:
34cat $XDG_RUNTIME_DIR/containers/auth.json
35
36# Get IP
37sudo podman inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' quay-app
38
39#unistall
40sudo ./mirror-registry uninstall -v \
41 --quayRoot <example_directory_name>
42
43# Info
44curl -u init:password https://quay01.example.local:8443/v2/_catalog | jq
45curl -u root:password https://<url>:<port>/v2/ocp4/openshift4/tags/list | jq
46
47# Get an example of imageset
48oc-mirror init --registry quay.example.com:8443/mirror/oc-mirror-metadata
49
50# Get list of Operators, channels, packages
51oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14
52oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14 --package=kubevirt-hyperconverged
53oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14 --package=kubevirt-hyperconverged --channel=stable
1QUAY_POSTGRES=`podman ps | grep quay-postgres | awk '{print $1}'`
2
3podman exec -it $QUAY_POSTGRES psql -d quay -c "UPDATE "public.user" SET invalid_login_attempts = 0 WHERE username = 'init'"