Geeks With Blogs
Josh Reuben

The Docker CLI commands actually encapsulate Rest calls to the host Docker Daemonhttps://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/

The daemon listens on unix:///var/run/docker.sock - which you can curl into: curl --unix-socket /var/run/docker.sock http:/containers/json

  • In theory, a Container app could be Cluster-enabled via startup calls to the host Docker Remote REST API !
POST /swarm/join
POST /services/create

Here's a summary of the exposed API surface:

Containers

  • GET /containers/json - List containers
  • POST /containers/create - Create a container
  • GET /containers/(id or name)/json - Inspect a container
  • GET /containers/(id or name)/top - List processes running in a container
  • GET /containers/(id or name)/logs - Get container logs
  • GET /containers/(id or name)/changes - Inspect changes on a container’s filesystem
  • GET /containers/(id or name)/export - Export a container
  • GET /containers/(id or name)/stats - Get container stats based on resource usage
  • POST /containers/(id or name)/resize - Resize a container TTY
  • POST /containers/(id or name)/start - Start a container
  • POST /containers/(id or name)/stop - Stop a container
  • POST /containers/(id or name)/restart - Restart a container
  • POST /containers/(id or name)/kill - Kill a container
  • POST /containers/(id or name)/update - Update a container config
  • POST /containers/(id or name)/rename - Rename a container
  • POST /containers/(id or name)/pause - Pause a container
  • POST /containers/(id or name)/unpause - Unpause a container
  • POST /containers/(id or name)/attach - Attach to a container
  • GET /containers/(id or name)/attach/ws - Attach to a container (websocket)
  • POST /containers/(id or name)/wait - Wait for a container
  • DELETE /containers/(id or name) - Remove a container
  • HEAD /containers/(id or name)/archive - Retrieving information about files and folders in a container
  • GET /containers/(id or name)/archive - Get an archive of a filesystem resource in a container
  • PUT /containers/(id or name)/archive - Extract an archive of files or folders to a directory in a container

Images

  • GET /images/json - Build image from a Dockerfile
  • POST /build - List Images
  • POST /images/create - Create an image
  • GET /images/(name)/json - Inspect an image
  • GET /images/(name)/history - Get the history of an image
  • POST /images/(name)/push - Push an image on the registry
  • POST /images/(name)/tag - Tag an image into a repository
  • DELETE /images/(name) - Remove an image
  • GET /images/search - Search images

Misc

  • POST /auth - Check auth configuration
  • GET /info - Display system-wide information
  • GET /version - Show the docker version information
  • GET /_ping - Ping the docker server
  • POST /commit - Create a new image from a container’s changes
  • GET /events - Monitor Docker’s events
  • GET /images/(name)/get - Get a tarball containing all images in a repository
  • GET /images/get - Get a tarball containing all images
  • POST /images/load - Load a tarball with a set of images and tags into docker
  • POST /containers/(id or name)/exec - Exec Create
  • POST /exec/(id)/start - Exec Start
  • POST /exec/(id)/resize - Exec Resize
  • GET /exec/(id)/json - Exec Inspect

Volumes

  • GET /volumes - List volumes
  • POST /volumes/create - Create a volume
  • GET /volumes/(name) - Inspect a volume
  • DELETE /volumes/(name) - Remove a volume

Networks

  • GET /networks - List networks
  • GET /networks/ - Inspect network
  • POST /networks/create - Create a network
  • POST /networks/(id)/connect - Connect a container to a network
  • POST /networks/(id)/disconnect - Disconnect a container from a network
  • DELETE /networks/(id) - Remove a network

Nodes

  • GET /nodes - list nodes
  • GET /nodes - inspect a node

Swarm

  • POST /swarm/init - Initialize a new Swarm
  • POST /swarm/join - Join an existing Swarm
  • POST /swarm/leave - Leave a Swarm
  • POST /swarm/update - Update a Swarm

Services

  • GET /services - List services
  • POST /services/create - Create a service
  • DELETE /services/(id or name) - Remove a service
  • GET /services/(id or name) - Inspect one or more services
  • POST /services/(id or name)/update - Update a service

Tasks

  • GET /tasks - List tasks
  • GET /tasks/(task id) - Inspect a task

Happy Docking !

Posted on Thursday, December 15, 2016 5:27 AM Cloud , Docker | Back to top


Comments on this post: Docker REST API Quickref

# re: Docker REST API Quickref
Requesting Gravatar...
It seems difficult to follow through, but will surely try the steps and see the results. - Dr. Thomas Devlin
Left by James Michael on Dec 17, 2016 6:57 PM

# Best ielts preparation/coaching classes in chandigarh | Mohali.
Requesting Gravatar...
Think Englsih is a best Ielts preparation institute in Chandigarh | Mohali and provide best ielts preparation practice classes for students. Here we provide our best or experienced faculty members to guide you and which they all faculty members share their personal experience and high qualified knowledge with all of you. Under their guidance you have a best chance to improve your skills and bright your future.

For ielts coaching we provide a well settled atmosphere which also increases your learning interest as well as your confidance level which always helps you in future.

For more further information you can check out it now :

Left by Think English on Dec 19, 2016 11:46 AM

# re: Docker REST API Quickref
Requesting Gravatar...
I always find it very difficult to code a program and using this specific platform but after reading your post fill that I code a program with else.
Facebook customer service number
Left by jems rock on Feb 12, 2017 8:23 AM

# re: Docker REST API Quickref
Requesting Gravatar...
Left by Sumit smith on Jul 29, 2017 10:14 AM

Your comment:
 (will show your gravatar)


Copyright © JoshReuben | Powered by: GeeksWithBlogs.net