
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://github.com/serversideup/docker-ansible/actions/workflows/action_publish-images-production.yml
https://github.com/serversideup/docker-ansible/blob/main/LICENSE
https://github.com/***/serversideup
https://hub.docker.com/r/serversideup/ansible/https://hub.docker.com/r/serversideup/ansible-core/
serversideup/ansible is a lightweight solution for running Ansible in a containerized environment. This project builds upon many things we learned from https://github.com/willhallonline/docker-ansible. It provides a secure and isolated environment for running Ansible tasks, with support for both Alpine and Debian-based distributions and gives you the flexibility to run Ansible as an unprivileged user without the headaches of proper file permissions.
Getting started is easy. Here's a few tips on how to use this image.
ansible and ansible-coreOur images are available on Docker Hub and GitHub Container Registry 🥳
DockerHub:
GitHub Container Registry:
Versions are made available with ansible and ansible-core. Everything is versioned appropriately according to the https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html.
| Variation | Image Size | Description |
|---|---|---|
serversideup/ansible-core | Lightweight, core installation of Ansible. | |
serversideup/ansible | "Batteries included" installation of Ansible. |
Our Docker images use a comprehensive tagging system for flexibility and specificity.
| Component | Example |
|---|---|
| Ansible version | 2.21.2, 2.21 |
| Base OS | alpine3.24, trixie |
| Python version | python3.14 |
| OS family | alpine, debian |
| Tag | Meaning |
|---|---|
2.21.2-alpine3.24-python3.14 | Most specific |
2.21.2-alpine3.24 | Latest Python for specific Ansible and OS |
2.21.2 | Latest OS and Python for specific Ansible |
2.21-alpine3.24-python3.14 | Latest patch for Ansible minor version |
2.21-alpine-python3.14 | OS family-based |
[!IMPORTANT]
In almost all cases you will need to mount a volume to the Ansible "working directory" (default:/ansible) and your SSH configurations (usually~/.ssh).
bashdocker run --rm -it \ -v "$HOME/.ssh:/ssh" \ -v "$(pwd):/ansible" \ serversideup/ansible:latest ansible-playbook playbook.yml
bashdocker run --rm -it \ -v "$HOME/.ssh:/ssh" \ -v "$(pwd):/ansible" \ -e PUID=9999 -e PGID=9999 \ -e RUN_AS_USER=bob \ serversideup/ansible:latest ansible-playbook playbook.yml
bashdocker run --rm -it \ -v "$HOME/.ssh:/ssh" \ -v "$(pwd):/ansible" \ serversideup/ansible:latest /bin/sh
[!NOTE]
Working with SSH keys can be tricky, especially if we're setting aRUN_AS_USERdynamically. We created a few things to help reduce the headache of getting this configured.
The /ssh directory
By default, we have a /ssh directory that is symbolically linked from ~/.ssh. The /ssh directory is used as our single source of truth for SSH keys and configurations.
If you set RUN_AS_USER, the entrypoint will create a home directory at /home/${RUN_AS_USER}, then create a symbolic link from /home/${RUN_AS_USER}/.ssh to /ssh. This gives you the power to set your RUN_AS_USER to anything you want without us needing to predict what user you want to run as.
Mounting the SSH auth socket
The SSH auth socket is a Unix socket used by the SSH agent to communicate with other processes, allowing for secure key management. To use it with Docker, you can mount it as follows:
macOS:
bashdocker run --rm -it \ -v "$HOME/.ssh:/ssh:ro" \ -v "$HOME/.ssh/known_hosts:/ssh/known_hosts:rw" \ -v "$(pwd):/ansible" \ -v "/run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock" \ -e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" \ serversideup/ansible:latest ansible-playbook playbook.yml
Notice how we're matching the SSH_AUTH_SOCK to the host's socket. This is necessary for the SSH agent to communicate with the container.
Linux:
bashdocker run --rm -it \ -v "$HOME/.ssh:/ssh:ro" \ -v "$HOME/.ssh/known_hosts:/ssh/known_hosts:rw" \ -v "$(pwd):/ansible" \ -v "$SSH_AUTH_SOCK:$SSH_AUTH_SOCK" \ -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK" \ serversideup/ansible:latest ansible-playbook playbook.yml
You can customize the image easily with the following environment variables:
| Variable | Default | Description |
|---|---|---|
PUID | 1000 | Set the User ID that you'd like to run Ansible as |
PGID | 1000 | Set the Group ID that you'd like to run Ansible as |
RUN_AS_USER | ansible | The username you'd like to run Ansible as (this will be created for you and will default to an unprivileged user) |
DEBUG | false | Enable debug output of container startup |
As an open-source project, we strive for transparency and collaboration in our development process. We greatly appreciate any contributions members of our community can provide. Whether you're fixing bugs, proposing features, improving documentation, or spreading awareness - your involvement strengthens the project. Please review our code of conduct to understand how we work together respectfully.
Need help getting started? Join our *** community and we'll help you out!
All of our software is free an open to the world. None of this can be brought to you without the financial backing of our ***.
https://github.com/***/serversideup
Bronze ***
No bronze *** yet. https://github.com/***/serversideupSpecial Infrastructure ***
This project takes an incredible amount of computing power to build and maintain over 8,000 different docker image tags. We're extremely grateful for the following *** who help bring the power to ship more PHP.
https://hub.docker.com/u/serversideup
Individual Supporters
https://github.com/***/serversideup
We're Dan and Jay - a two person team with a passion for open source products. We created Server Side Up to help share what we learn.
Dan Pastori | Jay Rogers |
|---|---|
https://github.com/danpastori | https://github.com/jaydrogers |
If you appreciate this project, be sure to check out our other projects.
以下是 serversideup/ansible 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务