Today I set up the docker registry in Cloudron and linked it to the GitLab instance. As we're also using Docker in combination, I tried to add the registry also in Portainer.
It works without any problems, to add it, if you enable TLS and disable the certificate check because they are self-signed as mentioned in the KB article.
To export an image to the registry, you first have to go to images and add the tags with the slug of the repository in GitLab. After that, you're able to export the image.
Doing the same from the Container UI page it failed. Also the browsing the registry via the Portainer UI failed:
Sep 19 09:08:37 time="2022-09-19T07:08:37.105514892Z" level=warning msg="error authorizing context: authorization token required" go.version=go1.16.15 http.request.host="localhost:5000" http.request.id=0f1d08ef-ff99-4921-978e-f332e72c931d http.request.method=GET http.request.referer="https://portainer.example.com/" http.request.remoteaddr=111.112.113.114 http.request.uri="/v2/" http.request.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 172.18.0.1 - gitlab.username [19/Sep/2022:07:08:37 +0000] "GET /v2/ HTTP/1.1" 401 87 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 ::1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/ HTTP/1.0" 401 87 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 time="2022-09-19T07:08:37.16684767Z" level=info msg="authorized request" go.version=go1.16.15 http.request.host="localhost:5000" http.request.id=04bfc005-02d5-44a2-b970-f83bb1105f77 http.request.method=GET http.request.referer="https://portainer.example.com/" http.request.remoteaddr=111.112.113.114 http.request.uri="/v2/" http.request.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 time="2022-09-19T07:08:37.166918103Z" level=info msg="response completed" go.version=go1.16.15 http.request.host="localhost:5000" http.request.id=04bfc005-02d5-44a2-b970-f83bb1105f77 http.request.method=GET http.request.referer="https://portainer.example.com/" http.request.remoteaddr=111.112.113.114 http.request.uri="/v2/" http.request.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" http.response.contenttype="application/json; charset=utf-8" http.response.duration=1.673273ms http.response.status=200 http.response.written=2
Sep 19 09:08:37 172.18.0.1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/ HTTP/1.1" 200 2 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 127.0.0.1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/ HTTP/1.0" 200 2 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 ::1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/_catalog HTTP/1.0" 401 145 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 time="2022-09-19T07:08:37.28534889Z" level=warning msg="error authorizing context: authorization token required" go.version=go1.16.15 http.request.host="localhost:5000" http.request.id=d8c321cd-4c9d-4063-b274-c06a30de6a6f http.request.method=GET http.request.referer="https://portainer.example.com/" http.request.remoteaddr=111.112.113.114 http.request.uri="/v2/_catalog" http.request.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 172.18.0.1 - gitlab.username [19/Sep/2022:07:08:37 +0000] "GET /v2/_catalog HTTP/1.1" 401 145 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 127.0.0.1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/_catalog HTTP/1.0" 401 145 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 time="2022-09-19T07:08:37.54718746Z" level=warning msg="error authorizing context: insufficient scope" go.version=go1.16.15 http.request.host="localhost:5000" http.request.id=f1263d9d-17d7-4d84-955b-38bc2779d61e http.request.method=GET http.request.referer="https://portainer.example.com/" http.request.remoteaddr=111.112.113.114 http.request.uri="/v2/_catalog" http.request.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
Sep 19 09:08:37 172.18.0.1 - - [19/Sep/2022:07:08:37 +0000] "GET /v2/_catalog HTTP/1.1" 401 145 "https://portainer.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Maybe some API endpoints are not supported, like /v2/_catalog?
The Portainer KB points out, that the official Docker Registry API v2 have to be supported.
Perhaps some else also tried it with Portainer or have some ideas why it doesn't work.