The JSON field was added in [moby@9fd2c0f], to address [moby#19177], which reported an incompatibility with Classic (V1) Swarm, which produced a non- standard response; > Make docker load to output json when the response content type is json > Swarm hijacks the response from docker load and returns JSON rather > than plain text like the Engine does. This makes the API library to return > information to figure that out. A later change in [moby@96d7db6] added additional logic to make sure the correct content-type was returned, depending on whether the `quiet` option was set (which produced a non-JSON response). This caused inconsistency in the API response, and [moby@2f27632] changed the endpoint to always produce JSON (only skipping the "progress" output if `quiet` was set). This means that the "load" endpoint ([`imageRouter.postImagesLoad`]) now unconditionally returns JSON, making the `JSON` field fully redundant. This patch removes the use of the JSON field, as it's redundant, and the way it handles the content-type is incorrect because it would not handle correct, but different formatted response-headers (`application/json; charset=utf-8`), which could result in malformed output on the client. [moby@9fd2c0f]:9fd2c0feb0[moby#19177]: https://github.com/moby/moby/issues/19177 [moby@96d7db6]:96d7db665b[moby@2f27632]:2f27632cde[`imageRouter.postImagesLoad`]:7b9d2ef6e5/api/server/router/image/image_routes.go (L248-L255)Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Docker CLI
About
This repository is the home of the Docker CLI.
Development
docker/cli is developed using Docker.
Build CLI from source:
docker buildx bake
Build binaries for all supported platforms:
docker buildx bake cross
Build for a specific platform:
docker buildx bake --set binary.platform=linux/arm64
Build dynamic binary for glibc or musl:
USE_GLIBC=1 docker buildx bake dynbinary
Run all linting:
docker buildx bake lint shellcheck
Run test:
docker buildx bake test
List all the available targets:
make help
In-container development environment
Start an interactive development environment:
make -f docker.Makefile shell
Legal
Brought to you courtesy of our legal counsel. For more context, see the NOTICE document in this repo.
Use and transfer of Docker may be subject to certain restrictions by the United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.
For more information, see https://www.bis.doc.gov
Licensing
docker/cli is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.