我在 ramdisk 上启动的机器无法启动 docker 容器。
例如,运行hello-world结果为
$ docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"rootfs_linux.go:109: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"": unknown.
ERRO[0000] error waiting for container: context canceled
Run Code Online (Sandbox Code Playgroud)
不幸的是,该DOCKER_RAMDISK=true变量似乎没有效果。我在重新启动 docker 服务之前设置了它,systemctl restart docker但没有效果。(我在 Debian Buster)
如果该设置适用于dockerd,则尝试在 systemd 中进行配置(应该只能将以下内容复制/粘贴到 root shell 中):
mkdir -p /etc/systemd/system/docker.service.d
cat >/etc/systemd/system/docker.service.d/10-ramdisk.conf <<EOF
[Service]
Environment=DOCKER_RAMDISK=true
EOF
systemctl daemon-reload
systemctl restart docker
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2439 次 |
| 最近记录: |