Skip to content

Running cmd in container on remote docker host hangs #331

@xmik

Description

@xmik

I have a problem with running a command in docker container on remote docker host. When I do that locally, all is fine. On remote docker host, the command is invoked, I see stdout, but it hangs then. Am I doing something wrong?

How to reproduce:

base_image = Docker::Image.create('fromImage' => 'alpine:3.2')
container = base_image.run(['/bin/echo', '123'])
container.attach(stream: true, stdout: true,
                 stderr: true, logs: true, tty: false) do |stream, chunk|
  puts("#{stream}: #{chunk}".strip())
end
container.delete()

This is similar to #251.


Update
This works fine (locally and remotely) when using docker client command line:

$ DOCKER_HOST=tcp://<remote_ip>:2375 docker run -ti alpine:3.2 /bin/echo 123
123
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions