Skip to content

Unable to Modify ulimit Within /etc/docker/daemon.json #29385

Description

@AdamBouhmad

Description

Hey all! I Recently found an odd bug with the Docker Daemon through my adventures of hardening a container. I want to modify the values for ulimit via the daemon.json file in accordance with the CIS_Docker 1.12 benchmark, and I quickly referred to the docker docs, however it seems through my search, I came up empty on a documented way to do this. I attempted to follow #25566 as a guide, however values that I input to the "default-ulimits" field return errors, and thus the docker daemon is unable to be started.

Steps to reproduce the issue:

  1. If it's not already available, create the following file:
/etc/docker/daemon.json
  1. Add in the following line:
{"default-ulimits": {"nofile":"100:200"}}
  1. Restart the Docker daemon.

Describe the results you received:
level=fatal msg="unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: nofile\n"

Describe the results you expected:
Docker daemon should be able to start, and pass the --default-ulimit as an argument with the respective ulimits.

Additional information you deem important (e.g. issue happens only occasionally):
This runs cleanly through the command line for just nproc, and same for nofile:

dockerd --default-ulimit nproc=1024:2408 --default-ulimit nofile=100:200

Output of docker version:

Docker version 1.12.3, build 6b644ec

Additional environment details (AWS, VirtualBox, physical, etc.):
AWS

Extra: In the case that it's not a bug and simply lack of documentation, I would be more than willing to help document the use cases for ulimit, as currently there are no examples of modifying ulimit within daemon.json.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/daemonCore Enginekind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.version/1.12

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions