I got that error message when creating container.
Error response from daemon: too many open files
But I couldn't find any information about that error. (I saw https://github.com/docker/libcontainer/issues/211, but that was not the same problem of it.) Is there anyone who knows about it?
Thanks.
Limit a container's access to memory The maximum amount of memory the container can use. If you set this option, the minimum allowed value is 6m (6 megabytes). That is, you must set the value to at least 6 megabytes. The amount of memory this container is allowed to swap to disk.
If running elevated Docker commands does not fix the permission denied error, verify that your Docker Engine is running. Similar to running a docker command without the sudo command, a stopped Docker Engine triggers the permission denied error. How do you fix the error? By restarting your Docker engine.
Stop and remove all containers The following command is convenient if you want to stop/remove all the containers, including the running container. In this command, docker ps -a -q is used to display a list of IDs of all Docker containers, and docker rm is used to delete them.
Default limit of number of open files is 1024. You can increase it in two ways:
Run the container with --ulimit
parameter:
docker run --ulimit nofile=5000:5000 <image-tag>
Run the container with --privileged
mode and execute ulimit -n 5000
.
You can find more information here.
It's more convenient to set the ulimit inside the docker systemD service
Modify /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_ADD_RUNTIMES --default-ulimit nofile=65535:65535
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With