Commit 623102d4 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Use registry.port to construct the registry host

parent 38b63393
...@@ -332,15 +332,15 @@ class Project < ActiveRecord::Base ...@@ -332,15 +332,15 @@ class Project < ActiveRecord::Base
@container_registry_repository ||= begin @container_registry_repository ||= begin
token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace) token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace)
url = Gitlab.config.registry.api_url url = Gitlab.config.registry.api_url
host = Gitlab.config.registry.host host_port = Gitlab.config.registry.host_port
registry = ContainerRegistry::Registry.new(url, token: token, path: host) registry = ContainerRegistry::Registry.new(url, token: token, path: host_port)
registry[path_with_namespace] registry[path_with_namespace]
end end
end end
def container_registry_repository_url def container_registry_repository_url
if Gitlab.config.registry.enabled if Gitlab.config.registry.enabled
"#{Gitlab.config.registry.host}/#{path_with_namespace}" "#{Gitlab.config.registry.host_port}/#{path_with_namespace}"
end end
end end
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
To start using container images hosted on GitLab you first need to login: To start using container images hosted on GitLab you first need to login:
%pre %pre
%code %code
docker login #{Gitlab.config.registry.host} docker login #{Gitlab.config.registry.host_port}
%br %br
Then you are free to create and upload a container image with build and push commands: Then you are free to create and upload a container image with build and push commands:
%pre %pre
......
...@@ -249,9 +249,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes ...@@ -249,9 +249,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes
Settings['registry'] ||= Settingslogic.new({}) Settings['registry'] ||= Settingslogic.new({})
Settings.registry['enabled'] ||= false Settings.registry['enabled'] ||= false
Settings.registry['host'] ||= "example.com" Settings.registry['host'] ||= "example.com"
Settings.registry['port'] ||= nil
Settings.registry['api_url'] ||= "http://localhost:5000/" Settings.registry['api_url'] ||= "http://localhost:5000/"
Settings.registry['key'] ||= nil Settings.registry['key'] ||= nil
Settings.registry['issuer'] ||= nil Settings.registry['issuer'] ||= nil
Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].join(':')
# #
# Git LFS # Git LFS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment