
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Table of Contents generated with https://github.com/thlorenz/doctoc
https://img.shields.io/docker/automated/xakra/ansible-dockerizes.svg]() https://img.shields.io/docker/build/xakra/ansible-dockerized.svg]() https://img.shields.io/docker/pulls/xakra/ansible-dockerized.svg]()
ARG variable from Docker >= 1.10$ docker build . --build-args ansible_version=2.2.1.0
https://docs.docker.com/engine/reference/builder/#arg
Executes ansible-playbook command against an externally mounted set of Ansible playbooks.
docker run --rm -it \ -v PATH_TO_LOCAL_PLAYBOOKS_DIR:/ansible/playbooks \ xakra/ansible-dockerized \ PLAYBOOK_FILE \ <ANY_OPTION>
For example, assuming your project's structure follows best practices, the command to run ansible-playbook from the top-level directory would look like:
docker run --rm -it \ -v $(pwd):/ansible/playbooks \ xakra/ansible-dockerized \ site.yml
Note:
Ansible playbook variables can simply be added after the playbook name.
If Ansible is interacting with external machines, you'll need to mount an SSH key pair for the duration of the play:
docker run --rm -it \ -v ~/.ssh/id_rsa:/root/.ssh/id_rsa \ -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \ -v $(pwd):/ansible/playbooks \ xakra/ansible-dockerized site.yml
If you've encrypted any data using Ansible Vault, you can decrypt during a play by either passing --ask-vault-pass after the playbook name, or pointing to a password file. For the latter, you can mount an external file:
docker run --rm -it \ -v $(pwd):/ansible/playbooks \ -v ~/.vault_pass.txt:/root/.vault_pass.txt \ xakra/ansible-dockerized site.yml \ --vault-password-file /root/.vault_pass.txt
Note: the Ansible Vault executable is embedded in this image. To use it, specify a different entrypoint:
docker run --rm -it \ -v $(pwd):/ansible/playbooks \ --entrypoint /usr/bin/ansible-vault \ xakra/ansible-dockerized encrypt FILENAME
The Ansible Target Docker image is an SSH container optimized for testing Ansible playbooks.
First, define your inventory file.
[test] ansible_target
Be sure your testing playbooks include the correct host and remote user:
- hosts: test remote_user: ubuntu tasks: ... tasks go here ...
When testing the playbook, you'll need to link the two containers:
docker run --rm -it \ --link ansible_target \ -v ~/.ssh/id_rsa:/root/.ssh/id_rsa \ -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \ -v $(pwd):/ansible/playbooks \ xakra/ansible-dockerized tests.yml -i inventory
Note: the SSH key used above should match the one used to run Ansible Target.
Have a look at the bin/ansible file
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务