docker-java-api icon indicating copy to clipboard operation
docker-java-api copied to clipboard

Continue with Exec API

Open amihaiemil opened this issue 5 years ago • 6 comments

Let's continue with it. API is described here.

See contributing guidelines. Also, this might be helpful.

amihaiemil avatar Nov 04 '18 14:11 amihaiemil

Bug was reported, see §29: +15 point(s) just awarded to @amihaiemil/z

0crat avatar Feb 16 '20 09:02 0crat

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 avatar Apr 16 '20 15:04 edanilenko

@edanilenko It's not that complicated, don't worry. I'll implement the Execs.getExec(...) and RtExec, then it will be clear :D

amihaiemil avatar Apr 16 '20 16:04 amihaiemil

@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

amihaiemil avatar Apr 16 '20 18:04 amihaiemil

some problem with implementation of start method how it will work if we need interactive mode?

lumimul avatar Apr 22 '20 14:04 lumimul

@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

amihaiemil avatar Apr 22 '20 18:04 amihaiemil