Thanks to @Alex Past and @Stanislav for their help. But I did not receive full answers for me. I combined them. In conclusion, I received the following.
First
pstree -sg <PID>
where PID is the PID process from the top command
On output, I get the parent PID for the parent systemd process. This PID is the PID of the docker container.
After doing
docker ps -q | xargs docker inspect --format '{{.State.Pid}}, {{.Name}}' | grep "^%PID%"
where% PID% is the parent PID.
As a result, I have a container identifier CONKINER ID.
What i wanted
source share