Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

"exec" is not closing stdin #1684

Copy link
Copy link
Closed
Closed
Copy link
@veselov

Description

@veselov
Issue body actions

I'm sorry, this has been beaten a few times, but I can't find anything that I can understand on how to make the stdin work properly.

java-docker: 3.2.11
docker: ce-20.10.3-3.fc31

In short, it seems that the stdin stream used in exec command never closes. This seems to be the same as #1315 .
I've tried OkDockerHttpClient and Apache clients, with the same result. Jersey client fails with "Does not support hijacking", which is, AFAIU, expected.

The discussions in relevant issues all mention using Netty, but I don't understand how I can hook it up now.
DockerClientBuilder.withDockerCmdExecFactory() has been deprecated, and I don't see any other classes in netty-transport package that are exposed to the application. Using netty cmd factory does help (the command finishes properly), but since that mechanism is deprecated, I assume I'm not supposed to use it.

I've created a sample workspace that reproduces the issue for me: https://github.com/veselov/DockerTest

Relevant code:

            ExecCreateCmdResponse execCmd = docker
                    .execCreateCmd(containerId)
                    .withCmd("cat")
                    .withAttachStdin(true)
                    .withAttachStdout(true)
                    .withAttachStdin(true)
                    .exec();

            AnyResultCallBack<Frame> cb = docker
                    .execStartCmd(execCmd.getId())
                    .withStdIn(new MyStream())
                    .exec(makeLogResult());

            cb.awaitCompletion();

Strace on the container shows cat reading from 0, and the docker web-service is waiting for data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.