Skip to content

Conversation

@aboyett
Copy link

@aboyett aboyett commented Feb 28, 2018

The Docker API has offered support for a HostConfig.PidsLimit parameter
to the POST /containers/create route since API version 1.23. This
parameter allows limiting the maximum number of simultaneous processes
within the container.

This feature requires Linux kernel 4.3 or later and pids cgroup support.
Docker API 1.23 is known to be supported in Docker Engine 1.11.2 and
later.

This feature was tested by running ./bin.js alpine --pidslimit 10 on
the host and then running the following inside the spawned container:

/ # for i in $(seq 15) ; do
> eval "echo sleep \$i" ; sleep 10 &
> done
sleep 1
sleep 2
sleep 3
sleep 4
sleep 5
sleep 6
sleep 7
sleep 8
sleep 9
/bin/sh: can't fork

The Docker API has offered support for a HostConfig.PidsLimit parameter
to the POST /containers/create route since API version 1.23. This
parameter allows limiting the maximum number of simultaneous processes
within the container.

This feature requires Linux kernel 4.3 or later and pids cgroup support.
Docker API 1.23 is known to be supported in Docker Engine 1.11.2 and
later.

This feature was tested by running `./bin.js alpine --pidslimit 10` on
the host and then running the following inside the spawned container:

    / # for i in $(seq 15) ; do
    > eval "echo sleep \$i" ; sleep 10 &
    > done
    sleep 1
    sleep 2
    sleep 3
    sleep 4
    sleep 5
    sleep 6
    sleep 7
    sleep 8
    sleep 9
    /bin/sh: can't fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant