Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Example run commands in Dockerhub readme don't work

未关闭
#142 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker

调研方向

从包含两个 docker run 示例的 Docker Hub README 部分开始,检查报告的 HAProxy 文件描述符错误。更新文档以讨论 --privileged 和 --ulimit,包括它们的权衡和替代方案,或者以其他方式使命令按描述正常工作。完成标准是:示例不再在没有解释的情况下失败,并且推荐 flag 的后果清晰明确。

由索引模型根据 Issue 内容生成。

描述

question

Summary: The example run commands in the Dockerhub readme don't work, but they can be fixed by adding or discussing the --privileged or --ulimit flags.

The Dockerhub readme suggests the following docker run commands:

docker run -d --name my-running-haproxy --sysctl net.ipv4.ip_unprivileged_port_start=0 my-haproxy
# Or:
docker run -d --name my-running-haproxy \
  -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro --sysctl net.ipv4.ip_unprivileged_port_start=0 haproxy:2.3

When running either of these commands, HAProxy crashes with the following error message:

[ALERT] 040/170647 (8) : [haproxy.main()] Cannot raise FD limit to 8030, limit is 1024.

Running Docker in privileged mode lifts the 1024 limit on file descriptors. So that's one possible way to get past this error:

docker run -d --name my-running-haproxy --sysctl net.ipv4.ip_unprivileged_port_start=0 --privileged my-haproxy
# Or:
docker run -d --name my-running-haproxy \
  -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro --sysctl net.ipv4.ip_unprivileged_port_start=0 --privileged haproxy:2.3

Perhaps the readme should be updated to either:

  1. discuss the --privileged and --ulimit flags, their pros, their cons, and alternatives; or
  2. simply add --privileged to the example docker run commands.

Option 1 is probably better so as not to encourage use of --privileged without knowledge of the consequences.

I tested this against haproxy:latest and haproxy:alpine, which as of today map to HAProxy 2.3.5.

主要语言
Shell
星标
383
派生
162
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker-library/haproxy 的其他 Issue

查看 docker-library/haproxy 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。