
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Maintained by:
https://github.com/docker-library/haproxy
Where to get help:
https://dockr.ly/comm-slack, Server Fault, https://unix.stackexchange.com/help/on-topic, or https://stackoverflow.com/help/on-topic
Dockerfile linkshttps://github.com/docker-library/haproxy/blob/efe5fe70213c9d19e9f13e21c8c7160fa6648e30/3.5/Dockerfile
https://github.com/docker-library/haproxy/blob/efe5fe70213c9d19e9f13e21c8c7160fa6648e30/3.5/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/b71e05460e819fb232782af4ececabefcb13dcfc/3.4/Dockerfile
https://github.com/docker-library/haproxy/blob/b71e05460e819fb232782af4ececabefcb13dcfc/3.4/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/be82c5967740b4b0bfbf40dcf4d8d8e4c37a2035/3.3/Dockerfile
https://github.com/docker-library/haproxy/blob/be82c5967740b4b0bfbf40dcf4d8d8e4c37a2035/3.3/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/7a5c202cde713867a737033dca56e7a211a8b8df/3.2/Dockerfile
https://github.com/docker-library/haproxy/blob/7a5c202cde713867a737033dca56e7a211a8b8df/3.2/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/35f3a33fa2f01c68ac27b704a79185070f9ead6d/3.0/Dockerfile
https://github.com/docker-library/haproxy/blob/35f3a33fa2f01c68ac27b704a79185070f9ead6d/3.0/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/4d2c2c31a112dc9ef3b48021fd0565e8a7403179/2.8/Dockerfile
https://github.com/docker-library/haproxy/blob/4d2c2c31a112dc9ef3b48021fd0565e8a7403179/2.8/alpine/Dockerfile
https://github.com/docker-library/haproxy/blob/b3b97708ca92b***d15da7eaf6a0d614593/2.6/Dockerfile
https://github.com/docker-library/haproxy/blob/b3b97708ca92b***d15da7eaf6a0d614593/2.6/alpine/Dockerfile
Where to file issues:
https://github.com/docker-library/haproxy/issues?q=is:issue+is:pr
Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/haproxy/, https://hub.docker.com/r/arm32v5/haproxy/, https://hub.docker.com/r/arm32v6/haproxy/, https://hub.docker.com/r/arm32v7/haproxy/, https://hub.docker.com/r/arm64v8/haproxy/, https://hub.docker.com/r/i386/haproxy/, https://hub.docker.com/r/ppc64le/haproxy/, https://hub.docker.com/r/riscv64/haproxy/, https://hub.docker.com/r/s390x/haproxy/
Published image artifact details:
https://github.com/docker-library/repo-info/blob/master/repos/haproxy (https://github.com/docker-library/repo-info/commits/master/repos/haproxy)
(image metadata, transfer size, etc)
Image updates:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fhaproxy
https://github.com/docker-library/official-images/blob/master/library/haproxy (https://github.com/docker-library/official-images/commits/master/library/haproxy)
Source of this description:
https://github.com/docker-library/docs/tree/master/haproxy (https://github.com/docker-library/docs/commits/master/haproxy)
HAProxy is a free, open source high availability solution, providing load balancing and proxying for TCP and HTTP-based applications by spreading requests across multiple servers. It is written in C and has a reputation for being fast and efficient (in terms of processor and memory usage).
***.org/wiki/HAProxy
Since no two users of HAProxy are likely to configure it exactly alike, this image does not come with any default configuration.
Please refer to https://docs.haproxy.org/ on the subject of configuring HAProxy for your needs.
It is also worth checking out the http://git.haproxy.org/?p=haproxy-2.3.git;a=tree;f=examples.
DockerfiledockerfileFROM haproxy:2.3 COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
console$ docker build -t my-haproxy .
console$ docker run -it --rm --name haproxy-syntax-check my-haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
console$ docker run -d --name my-running-haproxy --sysctl net.ipv4.ip_unprivileged_port_start=0 my-haproxy
You will need a kernel at https://github.com/moby/moby/issues/8460#issuecomment-312459310 to use --sysctl net.ipv4.ip_unprivileged_port_start=0 , you may need to publish the ports your HAProxy is listening on to the host by specifying the -p option, for example -p 8080:80 to publish port 8080 from the container host to port 80 in the container. Make sure the port you're using is free.
Note: the 2.4+ versions of the container will run as USER haproxy by default (hence the --sysctl net.ipv4.ip_unprivileged_port_start=0 above), but older versions still default to root for compatibility reasons; use --user haproxy (or any other UID) if you want to run as non-root in older versions.
console$ 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
Note that your host's /path/to/etc/haproxy folder should be populated with a file named haproxy.cfg. If this configuration file refers to any other files within that folder then you should ensure that they also exist (e.g. template files such as 400.http, 404.http, and so forth). However, many minimal configurations do not require any supporting files.
If you used a bind mount for the config and have edited your haproxy.cfg file, you can use HAProxy's graceful reload feature by sending a SIGHUP to the container:
console$ docker kill -s HUP my-running-haproxy
The entrypoint script in the image checks for running the command haproxy and replaces it with haproxy-systemd-wrapper from HAProxy upstream which takes care of signal handling to do the graceful reload. Under the hood this uses the -sf option of haproxy so "there are two small windows of a few milliseconds each where it is possible that a few connection failures will be noticed during high loads" (see http://www.haproxy.org/download/2.3/doc/management.txt).
The haproxy images come in many flavors, each designed for a specific use case.
haproxy:<version>This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
Some of these tags may have names like trixie in them. These are the suite code names for releases of https://wiki.debian.org/DebianReleases and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.
haproxy:<version>-alpineThis image is based on the popular [***] available in https://hub.docker.com/_/alpine. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use https://musl.libc.org instead of https://www.etalabs.net/compare_libcs.html, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the https://hub.docker.com/_/alpine/ for examples of how to install packages if you are unfamiliar).
View http://www.haproxy.org/download/1.5/doc/LICENSE for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/haproxy.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
以下是 haproxy 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务