Giter Club home page Giter Club logo

Comments (6)

wader avatar wader commented on July 20, 2024

I think it is possible to change docker-api to returns a concatenated string in the order returned in the response from docker. But the order in which docker will return data is probably not that deterministic as the there is no concept of "order" between file descriptors.

from docker-api.

ucarion avatar ucarion commented on July 20, 2024

@wader Yes, now that I think about it I can see why I never should have even cared about stdout and stderr coming in at the "right" order.

But if I do something like container.attach[0].join, that'll get me stdout in the order it was outputted to, right?

(Closing this issue as it's not an issue at all.)

from docker-api.

wader avatar wader commented on July 20, 2024

Yeah that should work fine and be in correct order

from docker-api.

ucarion avatar ucarion commented on July 20, 2024

@wader Thanks!

from docker-api.

tlunter avatar tlunter commented on July 20, 2024

Since attach takes a block, the block will be yielded which stream it came from and the data from that stream.

data = ""
container.attach do |stream, msg|
  data << msg
end
puts data

This might be in the order you want? As @wader said though, who knows how Docker deals with it.

from docker-api.

ucarion avatar ucarion commented on July 20, 2024

@tlunter I think I'll stick with getting stdout and stderr separately, that seems like the "proper" way to do it.

Thanks for the help.

from docker-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.