docker-java-api
docker-java-api copied to clipboard
Continue with Exec API
Let's continue with it. API is described here.
See contributing guidelines. Also, this might be helpful.
The main problem is the exec command is a part of container, and the start command is a part of common docker api.
You should send POST request to /containers/{containerId}/exec for creating exec instance, then send POST to /exec/{execId}/start for starting.
So u should pass to RtContainer command and env arguments, then pass the execution id to RtDocker instance to invoke start, inspect, resize methods.
@edanilenko It's not that complicated, don't worry. I'll implement the Execs.getExec(...)
and RtExec
, then it will be clear :D
@edanilenko See how RtExec
is implemented. It still needs two more methods: start
and resize
.
You can create an Exec
via the Exec :: container.exec(...)
method. This method will make the HTTP Call to create the exec and then will return this.docker.execs().get(ID)
.
Makes sense? :D
some problem with implementation of start method how it will work if we need interactive mode?
@lumimul That's a good question... I'll look over it and try to think of something. If you have any ideas, I'm open for suggestions :D