Starting with Docker 20.10, the docker daemon has support for
"dual logging", which allows reading back logs, irregardless of
the logging-driver that is configured (except for "none" as logging
driver).
This patch removes the local check, which used a hard-coded list of
logging drivers that are expected to support reading logs.
When using an older version of Docker, the API should return an
error that reading logs is not supported, so no local check should
be needed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Move global console_handler into function scope
Signed-off-by: Mike Seplowitz <mseplowitz@bloomberg.net>
* Improve control over ANSI output
- Disabled parallel logger ANSI output if not attached to a tty.
The console handler and progress stream already checked whether the
output stream is a tty, but ParallelStreamWriter did not.
- Added --ansi=(never|always|auto) option to allow clearer control over
ANSI output. Since --no-ansi is the same as --ansi=never, --no-ansi is
now deprecated.
Signed-off-by: Mike Seplowitz <mseplowitz@bloomberg.net>
The order of precedence is:
- '--project-directory' option
- first file directory in '--file' option
- current directory
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
Closes: #6890
Some remarks,
- `# coding ... utf-8` statements are not needed
- isdigit on strings instead of a try-catch.
- Default opening mode is read, so we can do `open()` without the `'r'` everywhere
- Removed inheritinng from `object` class, it isn't necessary in python3.
- `super(ClassName, self)` can now be replaced with `super()`
- Use of itertools and `chain` on a couple places dealing with sets.
- Used the operator module instead of lambdas when warranted
`itemgetter(0)` instead of `lambda x: x[0]`
`attrgetter('name')` instead of `lambda x: x.name`
- `sorted` returns a list, so no need to use `list(sorted(...))`
- Removed `dict()` using dictionary comprehensions whenever possible
- Attempted to remove python3.2 support
Signed-off-by: alexrecuenco <alejandrogonzalezrecuenco@gmail.com>
When using the 'up' command, only services listed as arguments are
attached to, which can be very different to the 'no argument' case
if a service has many and deep dependencies:
- It's not clear when dependencies have failed to start. Have to run
'compose ps' separately to find out.
- It's not clear when dependencies are erroring. Have to run 'compose
logs' separately to find out.
With a simple setup, it's possible to work around theses issue by
using the 'up' command without arguments. But when there are lots of
'top-level' services, with common dependencies, in a single config,
using 'up' without arguments isn't practical due to resource limits
and the sheer volume of output from other services.
This introduces a new '--attach-dependencies' flag to optionally attach
dependent containers as part of the 'up' command. This makes their logs
visible in the output, alongside the listed services. It also means we
benefit from the '--abort-on-container-exit' behaviour when dependencies
fail to start, giving more visibility of the failure.
Signed-off-by: Ben Thorner <ben.thorner@digital.cabinet-office.gov.uk>
Avoid to attach to restarting containers and ignore
race conditions when trying to attach to already
dead containers
Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
This fix makes sure that stdin_open specified in the service
is considering when shelling out to the CLI
Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
This ensures that settings from any `.env` file (such as `DOCKER_HOST`) are
passed on to the cli.
Unit tests are adjusted for the new parameter and a new case is added to ensure
it is propagated as expected.
Fixes: 6661
Signed-off-by: Ian Campbell <ijc@docker.com>
- Improved CLI prompt
- Attempt volume preservation with new image config
- Fix container.rename_to_tmp_name()
- Integration test replicates behavior ; remove obsolete unit test
Signed-off-by: Joffrey F <joffrey@docker.com>
Catching the first container to exit Signed-off-by: Kevin Broadwater <kevin.broadwater@gmail.com>
Addressing feedback and fixing tests Signed-off-by: Kevin Broadwater <kevin.broadwater@gmail.com>
Adding break and removing extra fixture files Signed-off-by: Kevin Broadwater <kevin.broadwater@gmail.com>
Moving break Signed-off-by: Kevin Broadwater <kevin.broadwater@gmail.com>