fix: only pass ConsoleSize to ExecAttach when TTY is enabled
The moby/moby client (v0.2.2) validates that ConsoleSize is zero when TTY is disabled, returning “console size is only supported when TTY is enabled” otherwise. Previously, ConsoleSize was populated unconditionally from GetTtySize(), which returns real terminal dimensions when Compose is run interactively — causing post_start hooks to fail for services without
tty: true.Fix by only reading and passing the console size when service.Tty is true.
Signed-off-by: Michael Irwin michael.irwin@docker.com
Resolves #13615
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Table of Contents
Docker Compose
Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is used to define how one or more containers that make up your application are configured. Once you have a Compose file, you can create and start your application with a single command:
docker compose up.Where to get Docker Compose
Windows and macOS
Docker Compose is included in Docker Desktop for Windows and macOS.
Linux
You can download Docker Compose binaries from the release page on this repository.
Rename the relevant binary for your OS to
docker-composeand copy it to$HOME/.docker/cli-pluginsOr copy it into one of these folders to install it system-wide:
/usr/local/lib/docker/cli-pluginsOR/usr/local/libexec/docker/cli-plugins/usr/lib/docker/cli-pluginsOR/usr/libexec/docker/cli-plugins(might require making the downloaded file executable with
chmod +x)Quick Start
Using Docker Compose is a three-step process:
Dockerfileso it can be reproduced anywhere.compose.yamlso they can be run together in an isolated environment.docker compose upand Compose will start and run your entire app.A Compose file looks like this:
Contributing
Want to help develop Docker Compose? Check out our contributing documentation.
If you find an issue, please report it on the issue tracker.
Legacy
The Python version of Compose is available under the
v1branch.