Comments (3)
Hi,
I agree, this is a pretty helpful use case.
I'm not sure if this usecase is supported by docker`s remote API at all (but I think so).
As for reactive-docker, it should be possible. The futures should return upon receiving any response from the docker server. Now, I don't know the behavour of the docker server when attaching to a non-running container. Maybe it only sends some response when the container is being started.
I think we have to try this - will try to write a simple test case like this:
- create new container
- attach to container
- start container
is this the way you'd like it to work ?
from reactive-docker.
Ok, so this is the test case I came up with and which works fine with the current version of reactive-docker:
env.containerId.id must not be empty
val (it, en) = Concurrent.joined[Array[Byte]]
val maybeRes = (en &> DockerEnumeratee.rawStream |>>> Iteratee.head)
val attached = docker.attachStream(env.containerId, true, true, true)(it).flatMap(_.run)
val run = await(docker.containerStart(env.containerId))
val res = await(maybeRes)
res must not be empty
res.get.channel must be_==(0)
res.get.text must be_==("hello world")
note:
You do not want to wait for the attached
future to complete as this might never happen. You are attaching to a (possibly) infinite stream, so the future will never complete as the HTTP connection will never complete as well.
Instead, you should wait for your consumer iteratee to complete (if it is designed to complete)
Does this work for you ?
from reactive-docker.
Haven't tested it yet, but yes, I think it should work.
Btw, create+attach+start is also how docker run
works.
from reactive-docker.
Related Issues (12)
- Is this project maintained? HOT 3
- RepositoryTag does not support tags like "ip:port/xxx:yyy" HOT 6
- not working with api version 1.17
- test cases not running HOT 2
- Types of fields in ContainerConfiguration HOT 2
- Upgrade to support v13
- Upgrade to support v14
- Upgrade to support v15
- Upgrade to support v16
- Upgrade to support v17
- Upgrade to support v18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactive-docker.