has anyone used the :ContainerExec operation with Contajners ? For me it only returns an :Id but no output
Assuming docker is used, looking at https://docs.docker.com/engine/api/v1.45/#tag/Exec/operation/ContainerExec it suggests that you need to create it first and then start it: https://docs.docker.com/engine/api/v1.45/#tag/Exec/operation/ExecStart
its returning the id as the api expects. you may need to attach to the stdin, err and try the https://docs.docker.com/engine/api/v1.45/#tag/Exec/operation/ExecInspect after that
when the exec instance is started, using the logs api should get you the logs
thanks
how do I provide switches like -d and -i ?
The -d should be the detach option when starting the exec I think and the -I should be the tty I think. I havenโt tried it, just educated guesses. I helps if you look up the rest api docs rather than the cli usage. The CLI hides a lot of calls for you and has a different UX
Can checkout https://gist.github.com/cizixs/d3e12bb28489b3464e64d23c074b0e58
thanks, I'm learning Docker so I need to work out how docker run translates into steps with the engine api
its quite a fun journey! took me a while too
run for example is pull + container create + container start (with options to attach etc)
contajners maps to the api as the usage is via a language and has lower building blocks vs the CLI which is more abstract. also i can more easily follow their version changes and things like support other things like podman with a single clojure interface