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