-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] --pull
policy flag does not complain about invalid values and silently swallows subsequent options
#11104
Comments
Hello @liamjones |
Oh, interesting. v2.21.0 is the newest version available on the relevant server via apt currently (Ubuntu 20.04.6 LTS). Let me check nothing weird is up with the installation on that box. |
I went back through the ubuntu install instructions. There was still an old Behaviour is still the same. Interestingly, if that PR was only added in v2.22.0 I don't understand why I'm seeing this output from user@host:~/jenkins$ docker compose up --help
Usage: docker compose up [OPTIONS] [SERVICE...]
Create and start containers
Options:
--abort-on-container-exit Stops all containers if any container was stopped. Incompatible with -d
--always-recreate-deps Recreate dependent containers. Incompatible with --no-recreate.
--attach stringArray Restrict attaching to the specified services. Incompatible with --attach-dependencies.
--attach-dependencies Automatically attach to log output of dependent services.
--build Build images before starting containers.
-d, --detach Detached mode: Run containers in the background
--dry-run Execute command in dry run mode
--exit-code-from string Return the exit code of the selected service container. Implies --abort-on-container-exit
--force-recreate Recreate containers even if their configuration and image haven't changed.
--no-attach stringArray Do not attach (stream logs) to the specified services.
--no-build Don't build an image, even if it's missing.
--no-color Produce monochrome output.
--no-deps Don't start linked services.
--no-log-prefix Don't print prefix in logs.
--no-recreate If containers already exist, don't recreate them. Incompatible with --force-recreate.
--no-start Don't start the services after creating them.
--pull string Pull image before running ("always"|"missing"|"never") (default "missing")
--quiet-pull Pull without printing progress information.
--remove-orphans Remove containers for services not defined in the Compose file.
-V, --renew-anon-volumes Recreate anonymous volumes instead of retrieving data from the previous containers.
--scale scale Scale SERVICE to NUM instances. Overrides the scale setting in the Compose file if present.
-t, --timeout int Use this timeout in seconds for container shutdown when attached or when containers are already running.
--timestamps Show timestamps.
--wait Wait for services to be running|healthy. Implies detached mode.
--wait-timeout int Maximum duration to wait for the project to be running|healthy. |
and I think I misidentified the PR, that's changing it from always/missing/never. Looks like it was in like this from the start (9976077#diff-8d744271912deb0e53fc0cc830281171cb1c2273ad8e9568692fd316b7f0356cR75) so I'm not sure why I've only just started running into this issue today... |
@glours As 2.22.0 wasn't available on the server I tried reproducing locally on my mac (also with a completely different docker-compose file). I get the same behaviour. If I do docker compose version:
docker info:
|
Description
The new behaviour on
--pull
(from PR #10981 I think) just tripped me up.The command I'd been using with previous versions was:
docker compose up --build --pull --detach && docker compose logs -f
Today I was finding the containers exiting when I
^C
-ed from the logs. Initially I thought something was wrong withlogs -f
but it turned out it was never reaching the second command.What was happening was
--pull
was reading--detach
as its policy value so--detach
was never getting to theup
command.^C
was killing theup
command, nothing to do with thelogs
command.If
up
had failed to run and--pull
had complained that "--detach
is not a valid policy" the issue would have been more obvious.Steps To Reproduce
docker compose up --pull --detach
^C
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: