Docker Engine API via curl to get JSON output for list of running container ID only

Hi all,

I am trying to get a list of running container IDs via Docker API and using the curl command

My 1st command works to get at least a list of running containers in JSON format:

[root@centos7]# curl -g 'http://localhost:4243/containers/json?filters={"status":["running"]}'

However, I am only interested to get the output that shows only the container-IDs

For that, I looked at the Docker Engine API documentation and found that it does provide a parameter filters that do support combinations.

But I am not able to combine this with my above curl command to only get the container-ID in the JSON output.

Please help as how to do it.

My Docker Engine API version is v1.43

It may not be possible to limit the response to only ids. But you could pipe it through jq to get the desired result.