How to run command in container outside from docker?

Hello, I need to be able to retrain and deploy again in my application with predictionIO in a docker container, but the problem is that I don’t know how to do it remotely without having to enter the container. Hope someone can help me and guide me with some resolution. Thank you.
P.S. I tried to do it by guiding me through the documentation of the docker’s api, but without greater results.
Ii need an api example and how to send command docker from outside or some way to do this please.