Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"bash: sysctl: command not found" in debian:stretch-slim

when I pull the debian:stretch-slim from hub.docker.com, and then run a container(root), I find that bash: sysctl: command not found.

How can I use sysctl in debian:stretch-slim?

and many images are builded from debian:stretch-slim, so when I want to use sysctl in some other containers like that:

docker run --rm -it redis:latest --sysctl net.core.somaxconn=2048 redis-server

It will throw ERROR message.

It can be tested like:

docker pull debian:stretch-slim
docker run --rm -it debian:stretch-slim bash
root@7b923f27f7ee:/# sysctl
bash: sysctl: command not found
like image 724
Wei Avatar asked Feb 20 '19 07:02

Wei


1 Answers

Start your container with this command:

docker run --rm -it --sysctl net.core.somaxconn=2048 redis:latest redis-server

--sysctl should be docker run's argument and it should not be a command to your redis image

like image 200
Thilak Avatar answered Nov 11 '22 16:11

Thilak