Could someone please help me with remote api for docker exec to run a command?
I am able to run it directly:
# docker exec 941430a3060c date
Fri Apr 29 05:18:03 UTC 2016
Could someone please help me with remote api for docker exec to run a command?
I am able to run it directly:
# docker exec 941430a3060c date
Fri Apr 29 05:18:03 UTC 2016
The API section which would help you is:
Exec Create/Start
You can see some example in
integration-cli/docker_api_exec_test.go
create
:start
:inspect
:You have to follow below steps. I am adding rest api way. You can code it to any language.
Body
You have to select
Content-Type: application/json
when you POST the above data you will get id in response. You have to use the id in next step.
*The above will add cron job in container which will execute every five minute.
You have to select
Content-Type: application/json
Check response code, 200 is OK