I'm new to docker and I'm encountering an error when trying to run a Docker container and access its shell.
I've built an image named "friendnet-client" successfully. The image sets up a Node.js environment based on the node:20.3.0-alpine3.17 image.
FROM node:20.3.0-alpine3.17
WORKDIR /app
COPY . .
RUN npm install
When I try to open the shell of the container using the command:
docker run -it friendnet-client sh
I encounter the following error:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: invalid rootfs: stat /var/run/desktop-containerd/daemon/io.containerd.runtime.v2.task/moby/2fba0ba5512bd017e06c3a26b730ca76f9577fe50e5e1b2a24f29604dc011479/E:\my software\Docker\ProgramData/vfs/dir/149ecdeb95fccf2e7d1a4e8b5c60bf912e8d3b8d2ea7b5b7b53ab8220b8bd722: no such file or directory: unknown.
Before that, I've tried changing the data-root in my daemon.json configuration file to E:\my software\Docker\ProgramData as my C drive is full. Here's my daemon.json configuration:
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"data-root": "E:\\my software\\Docker\\ProgramData"
}
However, I'm uncertain whether this adjustment is related to the issue at hand. In the error message, the path appears to use both / and , resembling a search within the Linux file system during the execution of the command.
Could someone please help me understand what might be causing this error and how I can resolve it?
If your
C:drive is full then it's quite likely that some of that space is being consumed by Docker images and containers. This is what I suggest:daemon.jsonand restart Docker (or Docker Desktop) so that this takes effect.docker system prune -a. I'm not sure what the equivalent would be for Docker Desktop, but there must be an option to delete these.