Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
623102d4
Commit
623102d4
authored
May 16, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use registry.port to construct the registry host
parent
38b63393
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/models/project.rb
app/models/project.rb
+3
-3
app/views/projects/container_registry/index.html.haml
app/views/projects/container_registry/index.html.haml
+1
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-0
No files found.
app/models/project.rb
View file @
623102d4
...
...
@@ -332,15 +332,15 @@ class Project < ActiveRecord::Base
@container_registry_repository
||=
begin
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
url
=
Gitlab
.
config
.
registry
.
api_url
host
=
Gitlab
.
config
.
registry
.
hos
t
registry
=
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host
)
host
_port
=
Gitlab
.
config
.
registry
.
host_por
t
registry
=
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host
_port
)
registry
[
path_with_namespace
]
end
end
def
container_registry_repository_url
if
Gitlab
.
config
.
registry
.
enabled
"
#{
Gitlab
.
config
.
registry
.
host
}
/
#{
path_with_namespace
}
"
"
#{
Gitlab
.
config
.
registry
.
host
_port
}
/
#{
path_with_namespace
}
"
end
end
...
...
app/views/projects/container_registry/index.html.haml
View file @
623102d4
...
...
@@ -16,7 +16,7 @@
To start using container images hosted on GitLab you first need to login:
%pre
%code
docker login
#{
Gitlab
.
config
.
registry
.
host
}
docker login
#{
Gitlab
.
config
.
registry
.
host
_port
}
%br
Then you are free to create and upload a container image with build and push commands:
%pre
...
...
config/initializers/1_settings.rb
View file @
623102d4
...
...
@@ -249,9 +249,11 @@ Settings.artifacts['max_size'] ||= 100 # in megabytes
Settings
[
'registry'
]
||=
Settingslogic
.
new
({})
Settings
.
registry
[
'enabled'
]
||=
false
Settings
.
registry
[
'host'
]
||=
"example.com"
Settings
.
registry
[
'port'
]
||=
nil
Settings
.
registry
[
'api_url'
]
||=
"http://localhost:5000/"
Settings
.
registry
[
'key'
]
||=
nil
Settings
.
registry
[
'issuer'
]
||=
nil
Settings
.
registry
[
'host_port'
]
||=
[
Settings
.
registry
[
'host'
],
Settings
.
registry
[
'port'
]].
join
(
':'
)
#
# Git LFS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment