class Docker::Resource::Image
Public Instance Methods
history(name)
click to toggle source
# File lib/docker/resource/image.rb, line 19 def history(name) response = @connection.get("/images/#{name}/history") raise_if_image_not_found(response.status) response.body_as_json end
list(options = {})
click to toggle source
# File lib/docker/resource/image.rb, line 8 def list(options = {}) @connection.get('/images/json', options).body_as_json end
remove(name)
click to toggle source
# File lib/docker/resource/image.rb, line 34 def remove(name) status = @connection.delete("/images/#{name}").status raise_if_image_not_found(status) status == 204 end
search(term)
click to toggle source
# File lib/docker/resource/image.rb, line 40 def search(term) params = {term: term} @connection.get("/images/search", params).body_as_json end
show(name)
click to toggle source
Inspect an image
# File lib/docker/resource/image.rb, line 13 def show(name) response = @connection.get("/images/#{name}/json") raise_if_image_not_found(response.status) response.body_as_json end
tag(name, repository, options = {})
click to toggle source
# File lib/docker/resource/image.rb, line 26 def tag(name, repository, options = {}) options = options.merge(repo: repository) status = @connection.post("/images/#{name}/tag", options).status raise_if_image_not_found(status) raise(BadParameterError) if status == 400 status == 201 end
Private Instance Methods
raise_if_image_not_found(status)
click to toggle source
# File lib/docker/resource/image.rb, line 47 def raise_if_image_not_found(status) raise(Docker::Error::ImageNotFound) if status == 404 end