What is the equivalent remote api command for "docker run -d"?

I am trying to invoke docker commands using remote api.

The api docker console does not seem to have the "Separate mode" option. http://docs.docker.io/en/latest/commandline/command/run/

I could use this application in bash, and I would like to use it using a remote api. https://github.com/grigio/docker-stringer

+7
docker
source share
3 answers

Indeed, the remote API does not have a “disconnect” mode, since the “attach” mode is an additional endpoint.

If you want to run in disconnect mode using the remote API, just create and run your container without binding to it.

If the container is still disconnecting immediately, use docker logs <container id> to check for errors. The problem can have nothing to do with detach .

+7
source share

It’s important to understand that the docker run command encapsulates a number of commands from an API perspective:

  • pull image (if not available locally)
  • create container
  • attached to the container
  • launches container

So far, docker run -d is the same as above, but without the attach step.

Therefore, you need to create and run your container using the remote API.

If the container is still disconnecting immediately, use docker logs <container id> to check for errors. The problem can have nothing to do with detach .

+5
source share

As far as I can tell, the equivalent of the remote API -i CLI is "OpenStdin": true in the /containers/create call. Without this, it seems that everything that is read from stdin gets an EOT .

This is where stdin is initialized (or not initialized) as a channel to a container, I did not track it.

+1
source share

All Articles