docker-client icon indicating copy to clipboard operation
docker-client copied to clipboard

remove manual RawInputStream wrapper in client.logs()

Open gesellix opened this issue 10 years ago • 2 comments

The manual wrapping is currently necessary due to the remote api always returning text/plain content-type headers, so that the automated behaviour won't work. See https://github.com/docker/docker/issues/16885

As soon as the Docker deamon behaves as expected, the code at dockerClient.logs() can be removed (see https://github.com/gesellix/docker-client/blob/master/src/main/groovy/de/gesellix/docker/client/DockerClientImpl.groovy#L832).

gesellix avatar Oct 09 '15 16:10 gesellix

The docs for the current api version 1.41 now explicitly describe the response headers regarding the encoding and content-type:

logs returned as a stream in response body. For the stream format, see the documentation for the attach endpoint. Note that unlike the attach endpoint, the logs endpoint does not upgrade the connection and does not set Content-Type.

I still wonder why the api has such inconsistent behaviour, but at least it's documented since https://github.com/moby/moby/pull/38819.

gesellix avatar Jul 17 '21 16:07 gesellix

A possible fix is https://github.com/moby/moby/pull/39812

gesellix avatar Jul 20 '21 17:07 gesellix