Cannot retrieve the stats of my docker containers using Docker APIs

I have several containers that are running on my Centos7 VM and I would like to retrieve their CPU and Memory usage using the following command:

echo -e "GET /containers/(container_name)/stats HTTP/1.0\r\n" | \
  nc -U /var/run/docker.sock

However, I just receive the following message without any statistics:

  • User/pw/email Authentication for Cloudbees Docker Build and Deploy Jenkins plugin
  • Docker alpine image's basic commands are not working
  • My boot2docker installation seems to not be working. What am I doing wrong?
  • has anyone created a docker container using cake?
  • Kubernetes: stop CloudSQL-proxy sidecar container in multi container Pod/Job
  • Error running grunt in docker: Fatal error: Unable to find local grunt
  • HTTP/1.0 200 OK

    Server: Docker/1.10.3 (linux)

    Date: Sun, 22 Jan 2017 15:53:49 GMT

    Content-Type: text/plain; charset=utf-8

    The “containers/(container_name)/top” command works fine.

    Can you please help me to understand why I don’t receive this container’s statistics?

  • Apache docker container - Invalid command 'RewriteEngine'
  • Magento devbox not install
  • How to start 2 (or more) instances of Rocket.Chat using Docker Compose?
  • How to handle shell expansion in docker-compose when setting env variables
  • How can I access my docker maria db?
  • pika.BlockingConnection() failing inside containers, works well within VMs
  • One Solution collect form web for “Cannot retrieve the stats of my docker containers using Docker APIs”

    Command to use get the stats of the container:

    curl -X GET http://127.0.0.1:6000/containers/<container_id>/stats
    

    The stats will be displayed for every second.

    Stats can be fetched only for running containers.

    Refer this :

    how to configure docker daemon port.

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