You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When launching a dockerised process as root it is possible to execute some kind of init script to set sysctl values. But setting right ulimits is actually need the -privileged flag.
When run as user (-u flag) is there a way to do subj? I did not find any in docs.
Setting of any other stuff (like /dev/shm size, #2606) would be great.
It would be nice to allow users to change these limits, but we also probably want to default to set them to something lower, as to be able to handle many containers the docker daemon is generally set to a very large ulimit on nr of open files, which then gets inherited by all containers.
In order to run a chef server in a container I need to run postgres, which means I need to tune shmmax and shmall. The chef omnibus installer starts postgres to add base users and tables, which I cannot do right now since sysctl requires privileged mode and you can't have privileged build steps.
does anyone know the current status of this.....its a big deal that I can no longer run 'sysctl -w kernel.shmmax=1067108864' inside a container.......and has literally stopped my Docker use case from working going from 0.11.1 to 1.0.0....the default value that is populated is 32mb and is useless (amazon ec2, default redhat ami)
Same "kernel.shmmax" issue. Even when kernel.shmmax is set on the host prior to running a container (ubuntu 14.04 based). The limit inside the container is much lower (I don't know where the defaults come from). I can only use privileged mode to change it.
Is there a work around for setting ulimit -n . I have tried some of the suggestions on the google-group but no luck.
cat /proc/$(my_docker_pid>)/limits | grep files
shows that setting ulimit -n 65000 and restarting the daemon works but none of the containers I start after this seem to inherit that. I need this to work so I can run things like a database in a docker file
UPDATE:
so when I use nsenter from the host ulimit -a is reporting correctly.
when I use google's gcloud compute ssh --container my_container to ssh into the container it does not report correctly
I made some research and seems like this feature could be added in HostConfig and be applied right before CAP_SYS_ADMIN is dropped by libcontainer.
See also docker-archive/libcontainer#237, that would introduce a per-container blacklist for syscalls (including sysctl).
Hii, i am facing a critical issue while running oracle rac database in docker container solely as net.core* parameters are not set in container. I also tried with --net=host but that does not seem to help as it uses host network which limit connectivity between two rac containers and also hinders the installation.
Is there any workaround for setting --sysctl net.core* parameters with docker run?
Thanks in advance.
Thanks for your response @thaJeztah , i am using Docker-version 1.12.1 on ubuntu 4.4.0-59-generic but running --sysctl net.core.rmem_default=262144 parameter in priviledged mode shows the error -
docker: Error response from daemon: oci runtime error: open /proc/sys/net/core/rmem_default: no such file or directory.
Parameters are set in /etc/sysctl.conf and yet on running sysctl -a i am unable to grep "net.core.rmem_default = 262144".
Can u please guide me in this issue.Sorry for bothering as i am new to docker.
@thaJeztah No, since we don't know what the list is? :^( This is a case where there is a kernel sysctl which is not namespaced, but currently we believe the all NET* sysctls are namespaced, and that is all we check.
@daixiang0 this issue is a feature request, and the feature was implemented last year. If you have a bug to report, please open a new issue with the information that's requested in the issue template that's shown when you open the issue. Make sure your system is fully up-to-date as CentOS uses a rolling update model (i.e. CentOS 7.3 reached end of life after 7.4 was released).
I'm locking this issue for comments to prevent it from collecting unrelated issues (which easily go overlooked on closed issues); if you arrive here because you want to report a bug; open a new issue instead, thanks!
Activity
q53 commentedon Apr 7, 2014
Any comments?
[-]Correct way to set sysctl,ulimit when runnnig as user.[/-][+]set ulimit / file limit / nproc limit[/+][-]set ulimit / file limit / nproc limit[/-][+]set ulimit / file limit / nproc limit / sysctl[/+]alexlarsson commentedon May 22, 2014
It would be nice to allow users to change these limits, but we also probably want to default to set them to something lower, as to be able to handle many containers the docker daemon is generally set to a very large ulimit on nr of open files, which then gets inherited by all containers.
alexlarsson commentedon May 22, 2014
In particular, FD_SETSIZE is set to 1024 by default in most built linux apps, which breaks if the ulimit for nr of open files is > 1024
jeffbaier commentedon Jun 14, 2014
I would like to be able to change some network parameters at runtime without running the container in privileged mode. For example -
jhulten commentedon Jul 14, 2014
In order to run a chef server in a container I need to run postgres, which means I need to tune shmmax and shmall. The chef omnibus installer starts postgres to add base users and tables, which I cannot do right now since sysctl requires privileged mode and you can't have privileged build steps.
tinytelly commentedon Jul 15, 2014
does anyone know the current status of this.....its a big deal that I can no longer run 'sysctl -w kernel.shmmax=1067108864' inside a container.......and has literally stopped my Docker use case from working going from 0.11.1 to 1.0.0....the default value that is populated is 32mb and is useless (amazon ec2, default redhat ami)
mcieslik-mctp commentedon Jul 16, 2014
Same "kernel.shmmax" issue. Even when kernel.shmmax is set on the host prior to running a container (ubuntu 14.04 based). The limit inside the container is much lower (I don't know where the defaults come from). I can only use privileged mode to change it.
timcash commentedon Sep 20, 2014
Is there a work around for setting ulimit -n . I have tried some of the suggestions on the google-group but no luck.
cat /proc/$(my_docker_pid>)/limits | grep files
shows that setting ulimit -n 65000 and restarting the daemon works but none of the containers I start after this seem to inherit that. I need this to work so I can run things like a database in a docker file
UPDATE:
so when I use nsenter from the host ulimit -a is reporting correctly.
when I use google's gcloud compute ssh --container my_container to ssh into the container it does not report correctly
[-]set ulimit / file limit / nproc limit / sysctl[/-][+]set ulimit / file limit / nproc limit / sysctl tunables[/+]thockin commentedon Oct 17, 2014
This is starting to matter. Having control of ulimits seems like something docker needs to handle first-class.
freman commentedon Oct 25, 2014
+1
We too would find it most useful to be able to set sysctl environment.
We understand that security dictates locking /proc down but if we could send sysctl things to set via the docker command line
i.e. docker run --sysctl net.core.somaxconn=1024 image
This would be so awsome.
gdm85 commentedon Oct 27, 2014
The approach proposed on StackOverflow is a security nightmare.
I made some research and seems like this feature could be added in HostConfig and be applied right before CAP_SYS_ADMIN is dropped by libcontainer.
See also docker-archive/libcontainer#237, that would introduce a per-container blacklist for syscalls (including sysctl).
74 remaining items
cpuguy83 commentedon Aug 11, 2016
@nilyang It should work either way. The shell has no bearing in tweaking the kernel params.
vingrad commentedon Sep 20, 2016
@cpuguy83 but it's impossible to use "privileged" with docker service.
WARNING: unsupported parameter privileged
Mishi-999 commentedon Feb 3, 2017
Hii, i am facing a critical issue while running oracle rac database in docker container solely as net.core* parameters are not set in container. I also tried with --net=host but that does not seem to help as it uses host network which limit connectivity between two rac containers and also hinders the installation.
Is there any workaround for setting --sysctl net.core* parameters with docker run?
Thanks in advance.
thaJeztah commentedon Feb 4, 2017
@Mishi-999 what workaround do you need? This feature is implemented in #19265, and part of docker 1.12
Mishi-999 commentedon Feb 6, 2017
Thanks for your response @thaJeztah , i am using Docker-version 1.12.1 on ubuntu 4.4.0-59-generic but running --sysctl net.core.rmem_default=262144 parameter in priviledged mode shows the error -
docker: Error response from daemon: oci runtime error: open /proc/sys/net/core/rmem_default: no such file or directory.
Parameters are set in /etc/sysctl.conf and yet on running sysctl -a i am unable to grep "net.core.rmem_default = 262144".
Can u please guide me in this issue.Sorry for bothering as i am new to docker.
thaJeztah commentedon Feb 6, 2017
@Mishu-999 can you open a new issue with more details and the exact steps to reproduce?
rhatdan commentedon Feb 6, 2017
This might mean that the net/core/rmem_default is not namespaced in the kernel so it can not be set per container.
thaJeztah commentedon Feb 6, 2017
@rhatdan which means we should exclude that one from the list?
justincormack commentedon Feb 6, 2017
@thaJeztah no, thats not helpful. We could maybe improve the error message.
rhatdan commentedon Feb 6, 2017
@thaJeztah No, since we don't know what the list is? :^( This is a case where there is a kernel sysctl which is not namespaced, but currently we believe the all NET* sysctls are namespaced, and that is all we check.
Mishi-999 commentedon Feb 7, 2017
@thaJeztah created issue #30778
thaJeztah commentedon Oct 24, 2017
@daixiang0 this issue is a feature request, and the feature was implemented last year. If you have a bug to report, please open a new issue with the information that's requested in the issue template that's shown when you open the issue. Make sure your system is fully up-to-date as CentOS uses a rolling update model (i.e. CentOS 7.3 reached end of life after 7.4 was released).
I'm locking this issue for comments to prevent it from collecting unrelated issues (which easily go overlooked on closed issues); if you arrive here because you want to report a bug; open a new issue instead, thanks!