Presenting docket dtates inside html page by javascript

0 votes
How can I GET and present web services states inside HTML dashboard using javascript? Like If docker is stopped, I wan tit to show a red icon, if the response it taking a lot of time then yellow and so on. Please help!
Jun 20, 2018 in Docker by Damon Salvatore
• 5,510 points
28 views

1 answer to this question.

0 votes

Use the Docker Engine Api:Docker Engine API (v1.26)

And you can use GET/container/json will give you the details in json.

function getContainers(callback) {
    $.ajax({
        type: 'GET',
        url:  '/containers/json?all=1',
        dataType: 'json',
        success: function(data)
        {
          if( callback ) callback(data);
        },
        error: function(err)
        {
          // ...
        },
        timeout: 30000
    });
}

You can also refer to links below for more information

How to use docker remote api to create container?

Enable Docker Remote API - raspberry pi / raspbian

https://github.com/tgogos/rpi_docker_ui

answered Jun 20, 2018 by DareDev
• 6,810 points

Related Questions In Docker

0 votes
1 answer

Different file owner inside Docker container and in host machine Ask

Filesystems, at least in Unix- and Linux-like ...READ MORE

answered Jun 25, 2018 in Docker by Damon Salvatore
• 5,510 points
72 views
0 votes
1 answer

Different file owner inside Docker container and in host machine

Here is what you can try. Since ...READ MORE

answered Jun 27, 2018 in Docker by Atul
• 10,240 points
189 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,530 points
326 views
+1 vote
5 answers

Set containers timezones by using docker compose.

version "2" services: serviceA: ...READ MORE

answered Jul 8, 2018 in Docker by Atul
• 10,240 points
2,579 views
0 votes
1 answer
0 votes
1 answer

Using SSH keys inside docker container

Turns out when using Ubuntu, the ssh_config ...READ MORE

answered Jul 18, 2018 in Docker by Nilesh
• 6,880 points
872 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,540 points
156 views