When I try to run any Docker container with an interactive terminal, I get the following error:
$ docker run -it --rm my-container
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /dev/ptmx: no space left on device: unknown.
There is still plenty of free space on my current drive and the drive on which Docker is installed. The only reference of this issue I've found so far is in this forum post, where it is suggested that the amount of pseudo terminals exceeds the threshold. I tested this on my system:
$ ls /dev/pts | wc -l
756
$ sysctl kernel.pty.max
kernel.pty.max = 4096
and I found that the amount of pseudo terminals is still far below the max value. Removing exited containers and docker system prune
also didn't help. After docker system prune
, the number of files in /dev/pts
drops to 751, but the problem persists.
What's the issue and how to solve it?
- Docker version: 20.10.17, build 100c701
- System: Ubuntu 20.04
Increasing the max amount of pseudo-terminals with sudo sysctl -w kernel.pty.max=8192
does indeed mitigate this issue, but I assume, this only pushes the problem further into the future. Isn't there a more sustainable solution to this problem?