I try to get docker container details on my java code and successfully can get it. But I need to get the CPU & memory usage of Docker container. In the terminal itself, we
Docker CLI to make calls to Docker API.
Also you can use a Java API client availible on GitHub.