How to take JMap dump inside elasticsearch docker container?

I am running elasticsearch using docker container, and i want to take the heap dump of the elasticsearch.

When I exec inside the container, I couldn't find jmap inside it.

I tried installing openjdk8 package since the container runs on alphine, but I am getting permission denied error.

/usr/share/elasticsearch/bin $ apk add openjdk8
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied

/usr/share/elasticsearch/bin $ find / -name jmap
find: /root: Permission denied
find: /proc/tty/driver: Permission denied
/usr/share/elasticsearch/bin $

May be you need to sudo or run as root?

It is running on alphine docker container, sudo command is not there.

Would something like that work?

docker exec -it -u root /bin/bash

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.