Instead of calling Docker remote APIs, I need develop a program which just talks to Docker Linux Client (not Docker daemon). Here is my code
try {
To overcome the error you're facing, you should use "-i" instead of "-it". The -t arg tells docker to allocate a pseudo tty.
Having said that, I agree with Florian, you should use the docker remote api. https://docs.docker.com/engine/reference/api/docker_remote_api/