Method: Docker::Compose::Session#up

Defined in:
lib/docker/compose/session.rb

#up(*services, abort_on_container_exit: false, detached: false, timeout: 10, build: false, exit_code_from: nil, no_build: false, no_deps: false, no_start: false) ⇒ true

Idempotently up the given services in the project.

Parameters:

  • services (Array)

    list of String service names to run

  • detached (Boolean) (defaults to: false)

    if true, to start services in the background; otherwise, monitor logs in the foreground and shutdown on Ctrl+C

  • timeout (Integer) (defaults to: 10)

    how long to wait for each service to start

  • build (Boolean) (defaults to: false)

    if true, build images before starting containers

  • no_build (Boolean) (defaults to: false)

    if true, don’t build images, even if they’re missing

  • no_deps (Boolean) (defaults to: false)

    if true, just run specified services without running the services that they depend on

Returns:

  • (true)

    always returns true

Raises:

  • (Error)

    if command fails

[View source]

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/docker/compose/session.rb', line 87

def up(*services,
       abort_on_container_exit: false,
       detached: false, timeout: 10, build: false,
       exit_code_from: nil,
       no_build: false, no_deps: false, no_start: false)
  o = opts(
           abort_on_container_exit: [abort_on_container_exit, false],
           d: [detached, false],
           timeout: [timeout, 10],
           build: [build, false],
           exit_code_from: [exit_code_from, nil],
           no_build: [no_build, false],
           no_deps: [no_deps, false],
           no_start: [no_start, false]
  )
  run!('up', o, services)
  true
end