The old names were supposed to designate variables that get propagated
to the Docker daemon. This is not true for all contained options and
therefore confused me.
The new names focus on the placement after the top level command.
Signed-off-by: Harald Albers <github@albersweb.de>
- set flag name to `--exit-code-from` (and rename some variable,
function and test names to match)
- force cascade_stop to true when exit-code-from flag is set
- use lambda in filter statement
- check that selected container name is in the project before running
- remove fancy parsing of service name to container mappings: if there
are multiple containers in a service, return the first nonzero exit
value if any
- flake8 changes
Signed-off-by: Nathan J. Mehl <n@climate.com>
This commit allows `docker-compose` to access `top` for containers
much like running `docker top` directly on a given container.
This commit includes:
* `docker-compose` CLI changes to expose `top`
* Completions for `bash` and `zsh`
* Required testing for the new `top` command
Signed-off-by: Peter Urda <peter.urda@gmail.com>
Before this change:
```
$ docker-compose --file docker-compose.yml -<TAB>
-- option --
--help -h -- Get help
--host -H -- Daemon socket to connect to
--project-name -p -- Specify an alternate project name (default: directory name)
--skip-hostname-check -- Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)
--tls -- Use TLS; implied by --tlsverify
--tlscacert -- Trust certs signed only by this CA
--tlscert -- Path to TLS certificate file
--tlskey -- Path to TLS key file
--tlsverify -- Use TLS and verify the remote
--verbose -- Show more output
--version -v -- Print version and exit
```
(Note the `--file` argument is no longer available to complete.)
After this change:
```
docker-compose --file docker-compose.yml -<TAB>
-- option --
--file -f -- Specify an alternate docker-compose file (default: docker-compose.yml)
--help -h -- Get help
--host -H -- Daemon socket to connect to
--project-name -p -- Specify an alternate project name (default: directory name)
--skip-hostname-check -- Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)
--tls -- Use TLS; implied by --tlsverify
--tlscacert -- Trust certs signed only by this CA
--tlscert -- Path to TLS certificate file
--tlskey -- Path to TLS key file
--tlsverify -- Use TLS and verify the remote
--verbose -- Show more output
--version -v -- Print version and exit
```
Signed-off-by: Matt Bray <mattjbray@gmail.com>
Previously, the filtering on already selected services would break when
one service was a substring of another.
This commit fixes that.
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
Previously, the autocomplete for the build/pull commands would only add
services for which build/image were the _first_ keys, respectively, in
the docker-compose file.
This commit fixes this, so the appropriate services are listed
regardless of the order in which they appear
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
For autocomplete to work properly, we need to pass along some flags when
calling docker (--host, --tls, …) and docker-compose (--file, --tls, …).
Previously flags would only be passed to docker-compose, and the only
flags passed were --file and --project-name.
This commit makes sure that all relevant flags are passed to both
docker-compose and docker.
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
This has the added benefit of making autocompletion work when the
docker-compose config file is in a parent directory.
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
Up to now there were two special top-level options that required special
treatment: --project-name and --file (and their short forms).
For 1.7.0, several TLS related options were added that have to be passed
to secondary docker-compose invocations as well.
This commit introduces a scalable treatment of those options.
Signed-off-by: Harald Albers <github@albersweb.de>
Add --remove-orphans to CLI reference docs
Add --remove-orphans to bash completion file
Test orphan warning and remove_orphan option in up
Signed-off-by: Joffrey F <joffrey@docker.com>
Since 1.6.0, Compose supports multiple compose files specified with `-f`.
These need to be passed to the docker invocations done by the
completion.
Signed-off-by: Harald Albers <github@albersweb.de>
After conversion a file would immediately not load in docker-compose 1.6.0 with the message:
ERROR: Version in "./converted.yml" is invalid - it should be a string.
Signed-off-by: Anthon van der Neut anthon@mnt.org
Signed-off-by: Anthon van der Neut <a.van.der.neut@ruamel.eu>
If a warning is shown, and you happen to have no color setting in your (bash) prompt, the \033[37m setting, stays active. With the message hardly readable (light grey on my default light yellow background), that means the prompt is barely visible and you need to do `tput reset`.
Would probably be better if the background color was set as well in case you have dark on light theme by default in your terminal.
Signed-off-by: Anthon van der Neut <a.van.der.neut@ruamel.eu>
The previous approach assumed that the service list could be extracted
from a single file. It did not follow extends and overrides.
Signed-off-by: Harald Albers <github@albersweb.de>
- Remove --x-networking and --x-network-driver
- There's now no way to set a network driver - this will be added back
with the 'networks' key
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>