gpt4 book ai didi

linux - "bash: sysctl: command not found"在 debian :stretch-slim

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:43:43 26 4
gpt4 key购买 nike

当我从 hub.docker.com 中提取 debian:stretch-slim,然后运行一个容器(root)时,我发现 bash: sysctl: command not found

我如何在 debian:stretch-slim 中使用 sysctl?

许多图像都是从 debian:stretch-slim 构建的,所以当我想在其他一些容器中使用 sysctl 时:

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

它会抛出 ERROR 信息。

可以这样测试:

docker pull debian:stretch-slim
docker run --rm -it debian:stretch-slim bash
root@7b923f27f7ee:/# sysctl
bash: sysctl: command not found

最佳答案

使用此命令启动您的容器:

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

--sysctl 应该是 docker run 的参数,它不应该是对你的 redis image 的命令

关于linux - "bash: sysctl: command not found"在 debian :stretch-slim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54781393/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com