Method: Drydock::Project#run
- Defined in:
- lib/drydock/project.rb
#run(cmd, opts = {}, &blk) ⇒ Object
This instruction is used to run the command ‘cmd` against the current project. The `opts` may be one of:
-
‘no_commit`, when true, the container will not be committed to a new image. Most of the time, you want this to be false (default).
-
‘no_cache`, when true, the container will be rebuilt every time. Most of the time, you want this to be false (default). When `no_commit` is true, this option is automatically set to true.
-
‘env`, which can be used to specify a set of environment variables. For normal usage, you should use the `env` or `envs` instructions.
-
‘expose`, which can be used to specify a set of ports to expose. For normal usage, you should use the `expose` instruction instead.
-
‘on_build`, which can be used to specify low-level on-build options. For normal usage, you should use the `on_build` instruction instead.
337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/drydock/project.rb', line 337 def run(cmd, opts = {}, &blk) requires_from!(:run) cmd = build_cmd(cmd) run_opts = opts.dup run_opts[:author] = opts[:author] || build_opts[:author] run_opts[:comment] = opts[:comment] || build_opts[:comment] log_step('run', cmd, run_opts) chain.run(cmd, run_opts, &blk) self end |