Closed vasily-kartashov closed 3 years ago
It looks like you're already pretty close. The containerArchiveStream()
method returns a stream of the archive, whereas the containerArchive()
method returns a promise with the buffered contents of the archive. In your case, you may prefer awaiting the result of this promise instead.
Note that Docker always returns a TAR for the requested file(s). Accessing individual files in the TAR file format string or stream is out of scope for this library. Several libraries are available, one that is known to work is clue/reactphp-tar.
See also https://github.com/clue/reactphp-docker#tar-streaming for more details 👍
Given a container ID (let's say "123abd" and file path "/etc/screenshot.jpg"), is there a way to get the content of the file from outside the container?
At the moment it looks like following:
What's the proper way to get the complete content of the file before sending it back from a synchronous method?