ExDockerCompose v0.1.0 ExDockerCompose.Subcommands View Source

A module that is the source of truth for the supported subcommands on docker-compose. as well as how they should be used.

Link to this section Summary

Functions

Build the full command that should be running, this function will parse the arguments and will build a command line commnad out of the subcommand and the arguments and their parameters

Get a list of all supported subcommands

Link to this section Functions

Link to this function build_command(compose_bin, subcommand, compose_opts, opts) View Source
build_command(compose_bin :: String.t(), subcommand :: Atom.t(), compose_opts :: List.t(), opts :: List.t()) ::
  {:ok, full_command :: String.t()} |
  :no_such_command

Build the full command that should be running, this function will parse the arguments and will build a command line commnad out of the subcommand and the arguments and their parameters

Parameters

  • compose_bin - The full path to the docker-compose binary
  • subcommand - The subcommand that docker-compose will run.
  • compose_opts - A list of parameters and their optional arguments used for docker-compose cli - meaning not for the subcommand. For example: :f (-f) or :no_ansi (--no-ansi) Every item on the List is either an atom (:d, :timeout) or a tuple where the first item is the an Atom that is the paramter and the rest are arguments to the paramter (space separated). For example: [{:p, "project-name"}, {:f, "docker-compose.yml"}, :skip_hostname_check]
  • opts - A list of parameters and their optional arguments for the subcommand. The structure is similar to the one described in compose_opts, but those will come after the subcommand. For example: [:d, {:t, 10}].

TODO

Both opts and compose_opts currently only support one argument for a subcommand, i.e. [:d, {:t, 10},...] is ok while [:d, {:t, 10, 20}] is not.

Link to this function get_supported_subcommands() View Source
get_supported_subcommands() :: subcommands :: List.t()

Get a list of all supported subcommands

Examples

iex> ExDockerCompose.Subcommands.get_supported_subcommands()
[:build, :bundle, :config, :create,
:down, :events, :exec, :help,
:images, :kill, :logs, :pause,
:port, :ps, :pull, :push,
:restart, :rm, :run, :scale,
:start, :stop, :top, :unpause, :up]