Refresh net.core.somaxcomm (or any sysctl property) for docker containers
Just figured out how to solve this, now Elastic Beanstalk supports running a privileged containers and you just need to add the "privileged": "true"
to your Dockerrun.aws.json
as the following sample (please take a look at the container-1
):
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [{
"name": "container-0",
"essential": "false",
"image": "ubuntu",
"memory": "512"
}, {
"name": "container-1",
"essential": "false",
"image": "ubuntu",
"memory": "512",
"privileged": "true"
}]
}
Please note that I duplicated this answer from another thread.
Running commands in a Docker file
Setting sysctl's is only possible at runtime with the --sysctl option. From the docker-run(1) manual:
Configure namespaced kernel parameters at runtime
IPC Namespace - current sysctls allowed:
kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, kernel.shmmax, kernel.shmmni, kernel.shm_rmid_forced
Sysctls beginning with fs.mqueue.*
If you use the --ipc=host option these sysctls will not be allowed.
Network Namespace - current sysctls allowed:
Sysctls beginning with net.*
If you use the --network=host option these sysctls will not be allowed.
For example, for /proc/sys/net/core/somaxconn you may use --sysctl net.core.somaxconn=4096
.
Other kernel parameters in procfs and sysfs may be inherited (though others are not), so you should set them on the host.
Editing Files from dockerfile
I would use the following approach in the Dockerfile
RUN echo "Some line to add to a file" >> /etc/sysctl.conf
That should do the trick. If you wish to replace some characters or similar you can work this out with sed by using e.g. the following:
RUN sed -i "s|some-original-string|the-new-string |g" /etc/sysctl.conf
However, if your problem lies in simply getting the settings to "bite" this question might be of help.
Is it possible to launch privileged docker containers on Amazon elasticbeanstalk?
Just figured out how to solve this, now Elastic Beanstalk supports running a privileged containers and you just need to add the "privileged": "true"
to your Dockerrun.aws.json
as the following sample (please take a look at the container-1
):
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [{
"name": "container-0",
"image": "ubuntu",
"memory": "512"
}, {
"name": "container-1",
"image": "ubuntu",
"memory": "512",
"privileged": "true"
}]
}
Related Topics
Where Is Hardware Timer Interrupt
Merge PDF Files with Numerical Sort
Sort Across Multiple Files in Linux
Download Images from Google with Command Line
Not Authorized for Query on Admin.System.Namespaces on Mongodb
How to Sleep for 1 Second Between Each Xargs Command
View a Particular Line of a File Denoted by a Number
Linux Command to Empty All Files of a Directory
Arch Linux - Apt-Get Update Equivalent Command
How to Recursively Copy a Directory into Another and Replace Only the Files That Have Not Changed
The Return Code from 'Grep' Is Not as Expected on Linux
Error: Ld.So: Object Ld_Preload Cannot Be Preloaded: Ignored
Difference Between Patch and Diff Files
Bash Script Read All the Files in Directory
How to Close a Netcat Connection After a Certain Character Is Returned in the Response
How to Save Output of "Watch" to File
Difference Between Flat Memory Model and Protected Memory Model