-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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] docker compose ps --format json
no longer returns an array in 2.21.0
#10958
Comments
Hey @unikitty37 |
Got it — thanks! I was reading the release notes at https://docs.docker.com/compose/release-notes/, which don't have links to the underlying tickets. Would it be worth explicitly mentioning this there? |
Sure I'll open a PR to mention it there 👍 |
Thanks! |
Doesn't this represent a breaking change, requiring a major version bump? |
It certainly broke several of our builds since GitHub recently updated its Ubuntu runner images to use 2.21.0. |
The docker compose docs (https://docs.docker.com/engine/reference/commandline/compose_ps/#format) also still claim the output is array-formatted JSON, instead of a jsonlines-esque format. |
docker/compose#10958 Signed-off-by: Andrew Haines <haines@cerbos.dev>
* chore(deps): Bump grpc from 1.57.0 to 1.58.0 Bumps [grpc](https://github.com/google/grpc) from 1.57.0 to 1.58.0. - [Release notes](https://github.com/google/grpc/releases) - [Changelog](https://github.com/grpc/grpc/blob/master/doc/grpc_release_schedule.md) - [Commits](grpc/grpc@v1.57.0...v1.58.0) --- updated-dependencies: - dependency-name: grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump bundler from 2.4.13 to 2.4.19 Signed-off-by: Andrew Haines <haines@cerbos.dev> * Handle breaking change to `docker compose ps` output format docker/compose#10958 Signed-off-by: Andrew Haines <haines@cerbos.dev> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Andrew Haines <haines@cerbos.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Haines <haines@cerbos.dev>
docker/compose#10958 Signed-off-by: Andrew Haines <haines@cerbos.dev>
docker/compose#10958 Signed-off-by: Andrew Haines <haines@cerbos.dev>
docker/compose#10958 Signed-off-by: Andrew Haines <haines@cerbos.dev>
* Bump node from 20.5.1 to 20.6.1 * Bump npm from 9.8.1 to 10.1.0 * Drop support for Node.js 16 * Handle breaking change to `docker compose ps` output format docker/compose#10958 * Handle updated invalid argument error details in Cerbos 0.30 Signed-off-by: Andrew Haines <haines@cerbos.dev>
Not to be a prick but Docker doing something misleading and wrong doesn't seem to me to be just cause to break what worked and turn valid JSON into invalid JSON. Nor should this be considered JSON format when it isn't, in fact, valid JSON. This definitely pressed my "principle of the thing" button. This is the kind of command people have buried in codebases that are now broken -- codebases that might now have to compensate to support both to remain compatible with multiple Docker Compose versions on host machines. |
I'm impacted by this as well. @unikitty37 at the very least you should reopen this until the docs are updated to show the no json array behavior. |
Docker prior to version 2.21.0 returned valid json when calling `docker-compose ps --format json`. Newer versions now return a series of json objects. This bugfix utilizes jq in the cli to fix the issue. More info: docker/compose#10958
Description
The release notes for 2.21.0 state "Changed docker compose ps and docker compose ps --format=json output to align with Docker CLI."
However, in prior versions, the result was a valid JSON array. 2.21.0 returns individual objects, one after the other, with no
[ … ]
wrapper. This doesn't seem to be valid JSON.Although jq can handle this, Ruby's
JSON.parse
rejects it as invalid; I've not tried other parsers.Was this intended?
Steps To Reproduce
docker compose up -d
.docker-compose ps --format json
.Versions before 2.21.0 will return an array of objects; version 2.21.0 will return sequential objects, separated only by a new line.
Compose Version
Docker Environment
Anything else?
json_files.zip
This is occurring with OrbStack; Docker Desktop is still providing Docker Compose version v2.20.2-desktop.1, and is thus unaffected for now.
The text was updated successfully, but these errors were encountered: