Class: Contained::Command::DockerLogin

Inherits:
Base
  • Object
show all
Defined in:
lib/contained/command/docker_login.rb

Overview

User to ‘docker login` to a registry using a provided username and password.

Examples:

Contained::Task::Login.command(environment: "production", config: {
  registry: {
  server: "hub.docker.com",
  username: "root",
  password: "secret",
}) # => [:docker, :login, "hub.docker.com", "-u", "root", "-p", "secret"]

Constant Summary collapse

DEFAULT_SERVER =
"hub.docker.com"

Instance Method Summary collapse

Methods inherited from Base

command, #initialize

Constructor Details

This class inherits a constructor from Contained::Command::Base

Instance Method Details

#commandArray<Symbol,String>

Returns:

  • (Array<Symbol,String>)


18
19
20
21
22
23
24
25
26
# File 'lib/contained/command/docker_login.rb', line 18

def command
  [
    :docker,
    :login,
    server,
    "-u", username,
    "-p", password,
  ]
end