
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
注意:这是https://hub.docker.com/_/bash的`amd64`架构专用仓库——更多信息请参见官方镜像文档中的“https://github.com/docker-library/official-images#architectures-other-than-amd64”和官方镜像FAQ中的“https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what”。
维护者:
https://github.com/tianon/docker-bash,https://github.com/docker-library/official-images/pull/2217#issue-***
获取帮助:
https://dockr.ly/comm-slack、Server Fault、https://unix.stackexchange.com/help/on-topic或https://stackoverflow.com/help/on-topic
Dockerfile链接https://github.com/tianon/docker-bash/blob/33dd5c2ee28bf8f5a2429d538e2dbb3a00cd52a5/devel/Dockerfile
https://github.com/tianon/docker-bash/blob/3b56c1c4a4e381f8b53decf0917fddd2cd15c8d4/5.3/Dockerfile
https://github.com/tianon/docker-bash/blob/9fc164bd1a8e4bfe16c517623ce935dc821bbb08/5.2/Dockerfile
https://github.com/tianon/docker-bash/blob/8ba8423bc0d3339722d4ba2d1af1f53fd179f506/5.1/Dockerfile
https://github.com/tianon/docker-bash/blob/5f58d08f8ee4a558b8302ef22352af99d4beedfd/5.0/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/4.4/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/4.3/Dockerfile
https://github.com/tianon/docker-bash/blob/8556e37dc74a044cfd6e8255acfd116a5bdb8588/4.2/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/4.1/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/4.0/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/3.2/Dockerfile
https://github.com/tianon/docker-bash/blob/099d6114cbdb9b016fb8c4beb653187df002f66f/3.1/Dockerfile
https://github.com/tianon/docker-bash/blob/5ffa8349006e790fe3534d0a6c3100fd6d725407/3.0/Dockerfile
提交issue的地址:
https://github.com/tianon/docker-bash/issues?q=
支持的架构:(https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/bash/、https://hub.docker.com/r/arm32v6/bash/、https://hub.docker.com/r/arm32v7/bash/、https://hub.docker.com/r/arm64v8/bash/、https://hub.docker.com/r/i386/bash/、https://hub.docker.com/r/ppc64le/bash/、https://hub.docker.com/r/riscv64/bash/、https://hub.docker.com/r/s390x/bash/
镜像 artifact 详情:
https://github.com/docker-library/repo-info/blob/master/repos/bash(https://github.com/docker-library/repo-info/commits/master/repos/bash)
(镜像元数据、传输大小等)
镜像更新:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fbash
https://github.com/docker-library/official-images/blob/master/library/bash(https://github.com/docker-library/official-images/commits/master/library/bash)
本描述的来源:
https://github.com/docker-library/docs/tree/master/bash(https://github.com/docker-library/docs/commits/master/bash)
Bash 是 http://www.gnu.org/ 项目的 Bourne Again SHell,是 http://www.opengroup.org/onlinepubs/9699919799/nfindex.html的完整实现,具备交互式命令行编辑、在支持的架构上进行作业控制、csh 类特性(如历史替换和 brace 展开)以及其他众多功能。
https://tiswww.case.edu/php/chet/bash/bashtop.html
本镜像的主要目标使用场景是:在主发行版更新软件包前测试 Bash 新版本的特性,以及针对不同 Bash 版本测试 shell 脚本以确保兼容性。可能还有其他有趣的使用场景,但这是镜像最初创建时旨在解决的两个主要场景!
关于本镜像,有几个重要注意事项需要说明:
Bash 本身安装在 /usr/local/bin/bash,而非 /bin/bash,因此推荐的 shebang 是 #!/usr/bin/env bash,而非 #!/bin/bash(或者显式通过 bash /.../script.sh 运行脚本,而非让 shebang 自动调用 Bash)。镜像不包含 /bin/bash,但如果通过镜像中包含的包管理器安装 Bash,该包会安装到 /bin/bash,可能导致混淆(不过 /usr/local/bin 在 $PATH 中优先级高于 /bin,因此只要一致使用 bash 或 /usr/bin/env,镜像提供的 Bash 将被优先使用)。
镜像仅包含 Bash,因此如果脚本依赖外部工具(例如 jq),需要手动添加(例如通过 apk add --no-cache jq)。
console$ docker run -it --rm amd64/bash:4.4 bash-4.4# which bash /usr/local/bin/bash bash-4.4# echo $BASH_VERSION 4.4.0(1)-release
console$ docker run -it --rm -v /path/to/script.sh:/script.sh:ro amd64/bash:4.4 bash /script.sh ... $ docker run -it --rm -v /path/to/script.sh:/script.sh:ro amd64/bash:3.2 bash /script.sh ...
Dockerfile 测试脚本dockerfileFROM docker.xuanyuan.run/amd64/bash:4.4 COPY script.sh / CMD ["bash", "/script.sh"]
然后构建并运行 Docker 镜像:
console$ docker build -t my-bash-app . ... $ docker run -it --rm --name my-running-app my-bash-app ...
Bash 是自由软件,根据 http://www.gnu.org/licenses/gpl.html 发布。
与所有 Docker 镜像一样,本镜像可能还包含其他软件,这些软件可能采用其他许可证(例如基础发行版中的 Bash 等,以及包含的主要软件的任何直接或间接依赖项)。
一些能够自动检测到的额外许可证信息可能位于 https://github.com/docker-library/repo-info/tree/master/repos/bash中。
对于任何预构建镜像的使用,镜像用户有责任确保对本镜像的任何使用都符合其中包含的所有软件的相关许可证。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务