Class: Docker::Remote::Client
- Inherits:
-
Object
- Object
- Docker::Remote::Client
- Includes:
- Utils
- Defined in:
- lib/docker/remote/client.rb
Constant Summary collapse
- PORTMAP =
{ 'ghcr.io' => 443 }.freeze
- DEFAULT_PORT =
443
- STANDARD_PORTS =
[DEFAULT_PORT, 80].freeze
Instance Attribute Summary collapse
-
#creds ⇒ Object
readonly
Returns the value of attribute creds.
-
#registry_url ⇒ Object
readonly
Returns the value of attribute registry_url.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #catalog ⇒ Object
-
#initialize(registry_url, repo, username = nil, password = nil) ⇒ Client
constructor
A new instance of Client.
- #manifest_for(reference) ⇒ Object
- #tags ⇒ Object
Methods included from Utils
Constructor Details
#initialize(registry_url, repo, username = nil, password = nil) ⇒ Client
Returns a new instance of Client.
21 22 23 24 25 |
# File 'lib/docker/remote/client.rb', line 21 def initialize(registry_url, repo, username = nil, password = nil) @registry_url = registry_url @repo = repo @creds = Credentials.new(username, password) end |
Instance Attribute Details
#creds ⇒ Object (readonly)
Returns the value of attribute creds.
15 16 17 |
# File 'lib/docker/remote/client.rb', line 15 def creds @creds end |
#registry_url ⇒ Object (readonly)
Returns the value of attribute registry_url.
15 16 17 |
# File 'lib/docker/remote/client.rb', line 15 def registry_url @registry_url end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
15 16 17 |
# File 'lib/docker/remote/client.rb', line 15 def repo @repo end |
Instance Method Details
#catalog ⇒ Object
39 40 41 42 43 |
# File 'lib/docker/remote/client.rb', line 39 def catalog response = get("/v2/_catalog") potentially_raise_error!(response) JSON.parse(response.body) end |
#manifest_for(reference) ⇒ Object
33 34 35 36 37 |
# File 'lib/docker/remote/client.rb', line 33 def manifest_for(reference) response = get("/v2/#{repo}/manifests/#{reference}") potentially_raise_error!(response) JSON.parse(response.body) end |
#tags ⇒ Object
27 28 29 30 31 |
# File 'lib/docker/remote/client.rb', line 27 def response = get("/v2/#{repo}/tags/list") potentially_raise_error!(response) JSON.parse(response.body)['tags'] end |