4

My machine that boots on a ramdisk cannot start a docker container.

For example, running hello-world results in

$ 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

Unfortunately, the DOCKER_RAMDISK=true variable does not seem to have an effect. I set it before restarting the docker service with systemctl restart docker but with no effect. (I'm on Debian Buster)

Roper
  • 903
  • 1
  • 9
  • 17

1 Answers1

6

If the setting applies to dockerd, then try configuring this in systemd (should just be able to copy/paste the following into a 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
BMitch
  • 231,797
  • 42
  • 475
  • 450
  • I don't have an environment to test this in, but looking at the code it appears you are correct in seeing this as a `dockerd` rather than `docker` setting. Let me know if you get this to work and I'll look into sending a documentation PR. – BMitch Aug 08 '19 at 20:55