Limit memory on a Docker container doesn't work

前端 未结 5 1346
既然无缘
既然无缘 2020-12-12 22:04

I am running the last version of Docker on top of Ubuntu 13.04 (Raring Ringtail):

root@docker:~# docker version
Client version: 0.6.6
Go version (client         


        
5条回答
  •  失恋的感觉
    2020-12-12 22:51

    If you are using a newer version of Docker, then the place to look for that information is /sys/fs/cgroup/memory/docker//memory.limit_in_bytes:

    docker run --memory="198m" redis
    docker ps --no-trunc` # to get the container long_id
    313105b341eed869bcc355c4b3903b2ede2606a8f1b7154e64f913113db8b44a
    
    cat /sys/fs/cgroup/memory/docker/313105b341eed869bcc355c4b3903b2ede2606a8f1b7154e64f913113db8b44a/memory.limit_in_bytes
    207618048 # in bytes
    

提交回复
热议问题