问题描述
我在 Debian 8 上使用 xvfb 运行 Chrome.它一直工作到我打开一个标签并尝试加载内容.进程无声无息地死去...
I'm running Chrome with xvfb on Debian 8. It works until I open a tab and try to load content. The process dies silently...
幸运的是,我使用 docker run --shm-size=1G
让它在本地 docker 上顺利运行.
Fortunately, I have gotten it to run smoothly on my local docker using docker run --shm-size=1G
.
Chrome 中存在一个已知错误导致它当/dev/shm 太小时崩溃.
There is a known bug in Chrome that causes it to crash when /dev/shm is too small.
我正在部署到容器引擎,并检查操作系统规范.主机操作系统有一个固定的 7G 挂载到/dev/shm,但实际容器只分配了 64M.Chrome 崩溃.
I am deploying to Container engine, and inspecting the OS specs. The host OS has a solid 7G mounted to /dev/shm, but the actual container is only allocated 64M. Chrome crashes.
使用kubectl部署到容器引擎时如何设置/dev/shm的大小?
How can I set the size of /dev/shm when using kubectl to deploy to container engine?
推荐答案
将 emptyDir
安装到/dev/shm 并将媒体设置为 Memory
就成功了!
Mounting an emptyDir
to /dev/shm and setting the medium to Memory
did the trick!
spec:
volumes:
- name: dshm
emptyDir:
medium: Memory
containers:
- image: gcr.io/project/image
volumeMounts:
- mountPath: /dev/shm
name: dshm
这篇关于在容器引擎上定义/dev/shm 的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!