Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker on machine using a ramdisk doesn't work

Tags:

docker

ramdisk

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)

like image 440
Roper Avatar asked Oct 18 '25 14:10

Roper


1 Answers

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
like image 141
BMitch Avatar answered Oct 21 '25 05:10

BMitch