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.
22 23 24 25 26 |
# File 'lib/docker/remote/client.rb', line 22 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.
16 17 18 |
# File 'lib/docker/remote/client.rb', line 16 def creds @creds end |
#registry_url ⇒ Object (readonly)
Returns the value of attribute registry_url.
16 17 18 |
# File 'lib/docker/remote/client.rb', line 16 def registry_url @registry_url end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
16 17 18 |
# File 'lib/docker/remote/client.rb', line 16 def repo @repo end |
Instance Method Details
#catalog ⇒ Object
40 41 42 43 44 |
# File 'lib/docker/remote/client.rb', line 40 def catalog response = get("/v2/_catalog") potentially_raise_error!(response) JSON.parse(response.body) end |
#manifest_for(reference) ⇒ Object
34 35 36 37 38 |
# File 'lib/docker/remote/client.rb', line 34 def manifest_for(reference) response = get("/v2/#{repo}/manifests/#{reference}") potentially_raise_error!(response) JSON.parse(response.body) end |
#tags ⇒ Object
28 29 30 31 32 |
# File 'lib/docker/remote/client.rb', line 28 def response = get("/v2/#{repo}/tags/list") potentially_raise_error!(response) JSON.parse(response.body)['tags'] end |