L
L
lifeexample2022-03-05 12:59:15
ubuntu
lifeexample, 2022-03-05 12:59:15

Why does docker stats not display information after container restart?

Hello! Help, please solve the problem.
Containers are running in docker, each has a limit on the use of RAM
mem_limit: 128m
If the limit is exceeded, the container automatically restarts.
restart: unless-stopped
All good except for one thing...
After an automatic restart, resource usage statistics for this container are no longer displayed.
docker stats - after such a forced restart, displays MEM USAGE / LIMIT memory is always 0B / 0B

622332f808b70778933543.jpeg

If you restart docker-compose.yml, then the statistics begin to display correctly, until the next automatic restart.

Has anyone experienced something similar? How can this be fixed? Or perhaps there is another way to get the amount of memory used by a container.
If you do free -m inside the container, then it displays the total amount of memory on the host machine.

Thanks for the help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question