Search code examples
dockerdaemonsandbox

Docker on VM stoped working fine after shutdown


I'm working on a virtual machine with sandbox hdp ambari, nifi.... I needed more space so i did a resize on mymachine.vdi but to see that resize and asign more space to the partition, i have to shut down the machine.

When i start it again, "docker start sandbox-proxy" give the error specified down.

I'm trying to start sandbox-hdp , sandbox-proxy and mysql. Start sandbox-hdp works fine but when i try to start sandbox-proxy, docker gives me this error:

sudo docker start sandbox-proxy
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:58: mounting \\\"/home/ubuntu/Descargas/scripts/assets/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/ebbbe053a9670b801ef0119f4502630a618268fe87c586d2cd2cb8423142d737/merged\\\" at \\\"/var/lib/docker/overlay2/ebbbe053a9670b801ef0119f4502630a618268fe87c586d2cd2cb8423142d737/merged/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Error: failed to start containers: sandbox-proxy

Solution

  • From the error it seems you're trying to mount a directory on a file.

    Please go through this.

    You need to:

    • Check if file /home/ubuntu/Descargas/scripts/assets/nginx.conf exists on the daemon host.
    • if it didn't exist, docker now created a directory at the path above; remove that directory and replace it with the file you're trying to mount
    • You can also use the --mount flag instead of -v / --volume: the --mount flag will not automatically create a directory if the host-path is missing, but instead produce an error, so that you're aware the path (file/directory) on the host is missing.

    Hope it helps.