A workaround to change shared memory size for Docker containers in AWS ECS

Issue

Because of not supporting to specify the following docker run parameter, containers in ECS cannot resize the shared memory.

–shm-size

Solution

Here is a workaround:

1. In order to operate devices with a container, execute docker run command with “–priviledge=true

2. Run the following scripts with a contianer,

shm_dir=/dev/shm
umount $shm_dir
mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=1G shm $shm_dir

References

https://bugs.chromium.org/p/chromium/issues/detail?id=519952#c6

https://github.com/aws/amazon-ecs-agent/issues/787

posted on 2017-12-01 11:47 Anor 阅读() 评论() 编辑 收藏

版权声明:本文为anor原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:http://www.cnblogs.com/anor/p/7941304.html