Skip to content
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

Docker remote api data streaming #2786

Closed
hychan opened this issue Nov 20, 2013 · 4 comments
Closed

Docker remote api data streaming #2786

hychan opened this issue Nov 20, 2013 · 4 comments
Labels

Comments

@hychan
Copy link

hychan commented Nov 20, 2013

I'm using Ruby gem 'docker-api' with a Docker daemon running on a remote server.

I ran into timeout issue when I want to get output from running a command inside the container.

create an image

image = Docker::Image.create('fromImage'=>'base')

insert a local file into the image

image.insert_local('localPath'=>['/root/docker_scripts/install_prereqs.sh', '/root/docker_scripts/weaver_script.sh'], 'outputPath'=>'/tmp/')

get the image id from the response

image_data = eval("image.json")
puts image.json
image_id = image_data["id"]
inputs = Hash.new
inputs["Image"] = image_id
inputs["Cmd"] = ['ls -al']

create a container with the image id and the command 'ls -al'

myContainer = Docker::Container.create(inputs)

start the container and stream the output

myContainer.tap(&:start).attach {|stream,chunk| puts "#{stream}: #{chunk}"}

RESPONSE:
read time out reached
.docker_9f738e00-3424-0131-e558-525400c6ff8e [Status: failed]

@jpetazzo
Copy link
Contributor

Can you reproduce with the Docker CLI?

If you can reproduce with the Docker CLI, please explain how (since we don't all have a Ruby environment here, and it will be much easier to fix the problem if it can be reproduced with standard tools).
If you cannot reproduce with the Docker CLI, it is probably an issue with the Ruby gem.

Thank you!

@hychan
Copy link
Author

hychan commented Nov 30, 2013

image.insert_local('localPath'=>['/root/docker_scripts/install_prereqs.sh', '/root/docker_scripts/weaver_script.sh'], 'outputPath'=>'/tmp/')

I was unable to find the CLI that will accomplish the above step ( insert_local), could you please show mw an example how it can be represented using the CLI ?

Thank you.

@cpuguy83
Copy link
Member

ping @hychan is this still an issue?

@thaJeztah
Copy link
Member

Close as "stale"? It's very old now and there's no new information if this is still an issue. Also, this can be an issue with Ruby Gem, not Docker,

@cpuguy83 cpuguy83 closed this as completed Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants