Method: Docker::Image#push

Defined in:
lib/docker/image.rb

#push(creds = nil, options = {}) ⇒ Object

Push the Image to the Docker registry.

Raises:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/docker/image.rb', line 25

def push(creds = nil, options = {})
  repository = self.info['RepoTags'].first.split(/:/)[0] rescue nil

  raise ArgumentError, "Image does not have a name to push." unless repository

  credentials = creds || Docker.creds
  headers = Docker::Util.build_auth_header(credentials)
  connection.post(
    "/images/#{repository}/push",
    options,
    :headers => headers
  )
  self
end