DockerCompose (DockerCompose Elixir v0.1.1) View Source
Docker Compose CLI
Uses docker-compose
executable, it must be installed and working.
Link to this section Summary
Functions
docker-compose down
docker-compose restart
docker-compose start
docker-compose stop
docker-compose up
Link to this section Types
Link to this section Functions
Specs
down(Keyword.t()) :: {:ok, down_summary()} | {:error, integer(), down_summary()}
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 removed
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
Specs
restart(Keyword.t()) :: {:ok, restart_summary()} | {:error, integer(), restart_summary()}
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.
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
restarted_containers
- which containers were restarted
Specs
start(Keyword.t()) :: {:ok, start_summary()} | {:error, integer(), start_summary()}
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.
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
started_services
- which services were started
Specs
stop(Keyword.t()) :: {:ok, stop_summary()} | {:error, integer(), stop_summary()}
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.
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_services
- which services were stopped
Specs
up(Keyword.t()) :: {:ok, up_summary()} | {:error, integer(), up_summary()}
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.
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
created_containers
- which containers were createdcreated_networks
- which networks were createdpulled_images
- which images were pulled for which servicesremoved_orphan_containers
- which containers were removed ifremove_orphans: true
is specified