bash
1,获取完整id:
docker inspect 245| grep Id
root@lynxi:~# docker inspect 245| grep Id
"Id": "245ab167ed9a79873b31b3a38df2053870fe72f267c3c1a660df25c63e37e88b",
2,修改 ShmSize,单位为字节,默认大小为 64M(67108864)
vi /var/lib/docker/containers/245ab167ed9a79873b31b3a38df2053870fe72f267c3c1a660df25c63e37e88b/hostconfig.json
修改为1G(1073741824)
3,停止容器:docker stop 245
4,重启docker: systemctl restart docker
5,确认参数是否保存成功。
6,进入容器查看(成功修改!):
root@lynxi:~# docker exec -it 245 bash
root@245ab167ed9a:/# df -h /dev/shm/
Filesystem Size Used Avail Use% Mounted on
shm 1.0G 0 1.0G 0% /dev/shm