Search code examples
dockerdocker-api

Docker API start container returns 404


I try to control a Docker server via the Docker remote API.

Commands like

/containers/json?all=1

or

/containers/15999301b96f/stats

are working perfectly fine. But as soon as I try to start, stop or restart a container with

/containers/15999301b96f/start
/containers/15999301b96f/stop
/containers/15999301b96f/restart

I get a 404 error with the message {"message":"page not found"}.

I'm using docker 1.12.1 and API 1.24.

Thank you in advance!


Solution

  • For the /containers/(id or name)/[start|stop|restart] endpoints you need to send POST requests instead of GET.

    Reference: