View Source DockerCompose (DockerCompose Elixir v1.0.0)
Docker Compose CLI
Uses docker-compose
executable, it must be installed and working.
Summary
Functions
docker-compose down
docker-compose restart
docker-compose start
docker-compose stop
docker-compose up
Types
@type exit_code() :: non_neg_integer()
@type output() :: Collectable.t()
Functions
docker-compose down
Options
compose_path: path
- path to the compose if not in the standard locationproject_name: name
- compose project nameremove_orphans: true
- if true orphaned containers are removedcompatibility: true
- if true, runs compose in backward compatibility mode
Result
The function returns either {:ok, summary}
if the request is successful or {:error, exit_code, summary}
. The exit code is the exit code of the docker-compose process that failed.
Summary is a map with
stopped_containers
- which containers were stoppedremoved_containers
- which containers were removedremoved_networks
- which networks were removedremoved_orphan_containers
- which containers were removed ifremove_orphans: true
is specified
docker-compose restart
Options
compose_path: path
- path to the compose if not in the standard locationproject_name: name
- compose project nameservice: name
- name of the service to be restarted, can be specified multiple times to restart multiple services at once. If not specified at all then all services are restarted.compatibility: true
- if true, runs compose in backward compatibility mode
docker-compose start
Note this can only be used to start previously created and stopped services. If you want to create
and start the services use up/1
.
Options
compose_path: path
- path to the compose if not in the standard locationproject_name: name
- compose project nameservice: name
- name of the service to be started, can be specified multiple times to start multiple services at once. If not specified at all then all services are started.
docker-compose stop
Options
compose_path: path
- path to the compose if not in the standard locationproject_name: name
- compose project nameservice: name
- name of the service to be stopped, can be specified multiple times to stop multiple services at once. If not specified at all then all services are stopped.compatibility: true
- if true, runs compose in backward compatibility mode
docker-compose up
The command is executed in detached mode, result is returned after the whole command finishes, which might take a while if the images need to be pulled.
Options
compose_path: path
- path to the compose if not in the standard locationproject_name: name
- compose project nameforce_recreate: true
- if true all specified services are forcefully recreatedremove_orphans: true
- if true orphaned containers are removedservice: name
- name of the service that should be started, can be specified multiple times to start multiple services. If it's not specified at all then all services are started.compatibility: true
- if true, runs compose in backward compatibility modequiet_pull: true
- if true, pull without printing progress information