Thank you,
I removed the registry from my docker compose and just modify the gitlab.rb and now the registry is available.
However I don’t know why, I can connect to my registry but I can’t push in it.
root@test-gitlab-2:/home/test_docker# docker push registry.example.com/root/test/contai
ner_registry/test-hello-world
>
> The push refers to repository [registry.example.com/root/test/container_registry/test-h
> ello-world]
> af0b15c8625b: Preparing
> error parsing HTTP 404 response body: invalid character '<' looking for beginning of va
> lue: "<!DOCTYPE html>\n<html>\n<head>\n <meta content=\"width=device-width, initial-sc
> ale=1, maximum-scale=1\" name=\"viewport\">\n <title>The page you're looking for could
> not be found (404)</title>\n <style>\n body {\n color: #666;\n text-alig
> n: center;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n
> margin: auto;\n font-size: 14px;\n }\n\n h1 {\n font-size: 56px;\n
> line-height: 100px;\n font-weight: 400;\n color: #456;\n }\n\n h2 {\n
> font-size: 24px;\n color: #666;\n line-height: 1.5em;\n }\n\n h3
> {\n color: #456;\n font-size: 20px;\n font-weight: 400;\n line-heig
> ht: 28px;\n }\n\n hr {\n max-width: 800px;\n margin: 18px auto;\n
> border: 0;\n border-top: 1px solid #EEE;\n border-bottom: 1px solid white;\n
> }\n\n img {\n max-width: 40vw;\n display: block;\n margin: 40px au
> to;\n }\n\n a {\n line-height: 100px;\n font-weight: 400;\n color:
> #4A8BEE;\n font-size: 18px;\n text-decoration: none;\n }\n\n .containe
> r {\n margin: auto 20px;\n }\n\n .go-back {\n display: none;\n }\n\n
> </style>\n</head>\n\n<body>\n <a href=\"/\">\n <img src=\"data:image/svg+xml;base
> 64,PHN2ZyB3aWR0aD0iMjEwIiBoZWlnaHQ9IjIxMCIgdmlld0JveD0iMCAwIDIxMCAyMTAiIHhtbG5zPSJodHRw
> Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTEwNS4wNjE0IDIwMy42NTVsMzguNjQtMTE4Ljk
> yMWgtNzcuMjhsMzguNjQgMTE4LjkyMXoiIGZpbGw9IiNlMjQzMjkiLz4KICA8cGF0aCBkPSJNMTA1LjA2MTQgMj
> AzLjY1NDhsLTM4LjY0LTExOC45MjFoLTU0LjE1M2w5Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYiLz4KI
> CA8cGF0aCBkPSJNMTIuMjY4NSA4NC43MzQxbC0xMS43NDIgMzYuMTM5Yy0xLjA3MSAzLjI5Ni4xMDIgNi45MDcg
> Mi45MDYgOC45NDRsMTAxLjYyOSA3My44MzgtOTIuNzkzLTExOC45MjF6IiBmaWxsPSIjZmNhMzI2Ii8+CiAgPHB
> hdGggZD0iTTEyLjI2ODUgODQuNzM0Mmg1NC4xNTNsLTIzLjI3My03MS42MjVjLTEuMTk3LTMuNjg2LTYuNDExLT
> MuNjg1LTcuNjA4IDBsLTIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+CiAgPHBhdGggZD0iTTEwNS4wN
> jE0IDIwMy42NTQ4bDM4LjY0LTExOC45MjFoNTQuMTUzbC05Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYi
> Lz4KICA8cGF0aCBkPSJNMTk3Ljg1NDQgODQuNzM0MWwxMS43NDIgMzYuMTM5YzEuMDcxIDMuMjk2LS4xMDIgNi4
> 5MDctMi45MDYgOC45NDRsLTEwMS42MjkgNzMuODM4IDkyLjc5My0xMTguOTIxeiIgZmlsbD0iI2ZjYTMyNiIvPg
> ogIDxwYXRoIGQ9Ik0xOTcuODU0NCA4NC43MzQyaC01NC4xNTNsMjMuMjczLTcxLjYyNWMxLjE5Ny0zLjY4NiA2L
> jQxMS0zLjY4NSA3LjYwOCAwbDIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+Cjwvc3ZnPgo=\"\n
> alt=\"GitLab Logo\" />\n </a>\n <h1>\n 404\n </h1>\n <div class=\"container\"
> >\n <h3>The page could not be found or you don't have permission to view it.</h3>\n
> <hr />\n <p>The resource that you are attempting to access does not exist or you
> don't have the necessary permissions to view it.</p>\n <p>Make sure the address is c
> orrect and that the page hasn't moved.</p>\n <p>Please contact your GitLab administr
> ator if you think this is a mistake.</p>\n <a href=\"javascript:history.back()\" cla
> ss=\"js-go-back go-back\">Go back</a>\n </div>\n <script>\n (function () {\n
> var goBack = document.querySelector('.js-go-back');\n\n if (history.length > 1) {\
> n goBack.style.display = 'inline';\n }\n })();\n </script>\n</body>\n</
> html>\n"
>
I also tried :
root@test-gitlab-2:/home/test_docker# docker push registry.example.com/root/test/test-h
ello-world
The push refers to repository [registry.example.com/root/test/test-hello-world]
af0b15c8625b: Preparing
error parsing HTTP 404 response body: invalid character ‘<’ looking for beginning of va
lue: "\n\n\n <meta content="width=device-width, initial-sc
ale=1, maximum-scale=1" name="viewport">\n The page you’re looking for could
not be found (404)\n \n body {\n color: #666;\n text-alig
n: center;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n
margin: auto;\n font-size: 14px;\n }\n\n h1 {\n font-size: 56px;\n
line-height: 100px;\n font-weight: 400;\n color: #456;\n }\n\n h2 {\n
font-size: 24px;\n color: #666;\n line-height: 1.5em;\n }\n\n h3
{\n color: #456;\n font-size: 20px;\n font-weight: 400;\n line-heig
ht: 28px;\n }\n\n hr {\n max-width: 800px;\n margin: 18px auto;\n
border: 0;\n border-top: 1px solid #EEE;\n border-bottom: 1px solid white;\n
}\n\n img {\n max-width: 40vw;\n display: block;\n margin: 40px au
to;\n }\n\n a {\n line-height: 100px;\n font-weight: 400;\n color:
#4A8BEE;\n font-size: 18px;\n text-decoration: none;\n }\n\n .containe
r {\n margin: auto 20px;\n }\n\n .go-back {\n display: none;\n }\n\n
\n\n\n\n <a href="/">\n <img src="data:image/svg+xml;base
64,PHN2ZyB3aWR0aD0iMjEwIiBoZWlnaHQ9IjIxMCIgdmlld0JveD0iMCAwIDIxMCAyMTAiIHhtbG5zPSJodHRw
Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTEwNS4wNjE0IDIwMy42NTVsMzguNjQtMTE4Ljk
yMWgtNzcuMjhsMzguNjQgMTE4LjkyMXoiIGZpbGw9IiNlMjQzMjkiLz4KICA8cGF0aCBkPSJNMTA1LjA2MTQgMj
AzLjY1NDhsLTM4LjY0LTExOC45MjFoLTU0LjE1M2w5Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYiLz4KI
CA8cGF0aCBkPSJNMTIuMjY4NSA4NC43MzQxbC0xMS43NDIgMzYuMTM5Yy0xLjA3MSAzLjI5Ni4xMDIgNi45MDcg
Mi45MDYgOC45NDRsMTAxLjYyOSA3My44MzgtOTIuNzkzLTExOC45MjF6IiBmaWxsPSIjZmNhMzI2Ii8+CiAgPHB
hdGggZD0iTTEyLjI2ODUgODQuNzM0Mmg1NC4xNTNsLTIzLjI3My03MS42MjVjLTEuMTk3LTMuNjg2LTYuNDExLT
MuNjg1LTcuNjA4IDBsLTIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+CiAgPHBhdGggZD0iTTEwNS4wN
jE0IDIwMy42NTQ4bDM4LjY0LTExOC45MjFoNTQuMTUzbC05Mi43OTMgMTE4LjkyMXoiIGZpbGw9IiNmYzZkMjYi
Lz4KICA8cGF0aCBkPSJNMTk3Ljg1NDQgODQuNzM0MWwxMS43NDIgMzYuMTM5YzEuMDcxIDMuMjk2LS4xMDIgNi4
5MDctMi45MDYgOC45NDRsLTEwMS42MjkgNzMuODM4IDkyLjc5My0xMTguOTIxeiIgZmlsbD0iI2ZjYTMyNiIvPg
ogIDxwYXRoIGQ9Ik0xOTcuODU0NCA4NC43MzQyaC01NC4xNTNsMjMuMjczLTcxLjYyNWMxLjE5Ny0zLjY4NiA2L
jQxMS0zLjY4NSA3LjYwOCAwbDIzLjI3MiA3MS42MjV6IiBmaWxsPSIjZTI0MzI5Ii8+Cjwvc3ZnPgo="\n
alt="GitLab Logo" />\n \n
\n 404\n
\n <div class="container"
\n
The page could not be found or you don’t have permission to view it.
\n
\n The resource that you are attempting to access does not exist or you
don't have the necessary permissions to view it.
\n Make sure the address is c
orrect and that the page hasn't moved.
\n Please contact your GitLab administr
ator if you think this is a mistake.
\n Go back\n \n \n\n\n"
I configured like this (only the following lines) :
registry_external_url 'https://registry.example.com'
gitlab_rails['registry_enabled'] = true
registry['enable'] = true
nginx['listen_https'] = false
registry_nginx['enable'] = true
registry_nginx['proxy_set_headers'] = {
"Host" => "$http_host",
"X-Real-IP" => "$remote_addr",
"X-Forwarded-For" => "$proxy_add_x_forwarded_for",
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
registry_nginx['listen_port'] = 5050
Is it enought ?
Is this normal that the following lines staid uncomment like this ?
# gitlab_rails['registry_host'] = "registry.gitlab.example.com"
# gitlab_rails['registry_port'] = "5005"
# gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
# Notification secret, it's used to authenticate notification requests to GitLab appli$
# You only need to change this when you use external Registry service, otherwise
# it will be taken directly from notification settings of your Registry
# gitlab_rails['registry_notification_secret'] = nil
###! **Do not change the following 3 settings unless you know what you are
###! doing**
# gitlab_rails['registry_api_url'] = "http://localhost:5000"
# gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
# gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"
# registry['username'] = "registry"
# registry['group'] = "registry"
# registry['uid'] = nil
# registry['gid'] = nil
# registry['dir'] = "/var/opt/gitlab/registry"
# registry['registry_http_addr'] = "localhost:5000"
# registry['debug_addr'] = "localhost:5001"
# registry['log_directory'] = "/var/log/gitlab/registry"
# registry['env_directory'] = "/opt/gitlab/etc/registry/env"
# registry['env'] = {
# 'SSL_CERT_DIR' => "/opt/gitlab/embedded/ssl/certs/"
# }
# registry['log_level'] = "info"
# registry['log_formatter'] = "text"
# registry['rootcertbundle'] = "/var/opt/gitlab/registry/certificate.crt"
# registry['health_storagedriver_enabled'] = true
# registry['storage_delete_enabled'] = true
# registry['validation_enabled'] = false
# registry['autoredirect'] = false
# registry['compatibility_schema1_enabled'] = false
### Registry backend storage
###! Docs: https://docs.gitlab.com/ee/administration/container_registry.html#container$
# registry['storage'] = {
# 's3' => {
# 'accesskey' => 'AKIAKIAKI',
# 'secretkey' => 'secret123',
# 'region' => 'us-east-1',
# 'bucket' => 'gitlab-registry-bucket-AKIAKIAKI'
# }
# }
I had my " registry.gitlab.example.com " in my hosts file with 127.0.01
The push also doesn’t work with 127.0.01 or localhost.