如何从docker统计findMAX内存?

使用“docker stats”,您可以随时间看到容器的内存使用情况。

有没有办法find运行“docker统计”时,内存使用量的最高值?

你可以使用命令:

docker stats --no-stream | awk '{ print $3 }' | sed '1d'|sort | tail -1 

它将通过容器提供最高的内存。

让我解释命令:

  --no-stream : Disable streaming stats and only pull the first result awk '{ print $3 }' : will print MEM USAGE sed '1d' : will delete first entry that is % sort : it will sort the result tail -1 : it will give last entry that is highest.