What is equivalent remote api command to 'docker run -d'?

I’m trying to call docker commands via remote api.

Docker remote api does not seem to have ‘Detached mode’ option.
http://docs.docker.io/en/latest/commandline/command/run/

  • Guestbook example not working. Unable to connect to MASTER
  • How to copy docker images from one host to another?
  • Where to find the tomcat folder in the docker image
  • Docker - connection between containers in different hosts within the same overlay network
  • how to cache post requests with varnish?
  • Cassandra on Docker - nodetool connection issue
  • I could use this app in the bash, and I would like to use this via remote api.
    https://github.com/grigio/docker-stringer

  • Jenkins not able to access internet when running as docker container
  • How to create different Jenkins2 images , unlocked and with preloaded plugins?
  • Running eval in Jenkins execute shell
  • Upgrading Docker in Amazon linux AMI to 1.11.1
  • Send a wake on lan packet from a docker container
  • Copying file from host to container
  • 3 Solutions collect form web for “What is equivalent remote api command to 'docker run -d'?”

    Indeed, the remote API does not have a ‘dettach’ mode as the ‘attach’ mode is an extra endpoint.

    If you want to run in detach mode with the remote API, simply create and start your container without attaching to it.

    It’s important to understand the “docker run” command encapsulates a series of commands from an API perspective:

    • pull image (if not available locally)
    • create the container
    • attach to the container
    • starts the container

    While “docker run -d” is the same thing as above but without the “attach” step.

    Therefore, you need to create and then start your container when using the remote API.

    As far as I can tell, the remote API equivalent of the -i CLI option is "OpenStdin": true in the call to /containers/create. Without this it seems that anything reading from stdin receives EOT.

    This is where stdin is initialized (or not initialized) as a pipe to the container, I haven’t tracked it down past that.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.