如果你使用 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/doctor-server/tf2-dedicated-server/actions/workflows/docker-publish-gpr.yml/badge.svg?branch=main](https://github.com/doctor-server/tf2-dedicated-server/actions/workflows/docker-publish-gpr.yml)
This repository uses Docker and SteamCMD to download and check for updates to the TF2 dedicated server. If there's an update, it pushes the latest Docker image to the GitHub Docker registry.
| Image Name | Image Tag | Image Size |
|---|---|---|
| ghcr.io/doctor-server/tf2-dedicated-server | latest | 12.53 GB |
| ghcr.io/doctor-server/tf2-dedicated-server | slim | 4.04 GB |
slimremoves unnecessary files like maps, which helps reduce the image size.
To install the TF2 dedicated server from the command line, use one of the following commands:
shdocker pull ghcr.io/doctor-server/tf2-dedicated-server:latest
or, use slim tag for smaller image size and faster deployment. (Recommended)
shdocker pull ghcr.io/doctor-server/tf2-dedicated-server:slim
latest)First, create a temporary container to copy the necessary server files to your local tf directory:
docker create --name tf2-temp-server ghcr.io/doctor-server/tf2-dedicated-server:latest sleep infinity docker cp tf2-temp-server:/home/steam/serverfiles/tf/cfg ./tf docker cp tf2-temp-server:/home/steam/serverfiles/tf/maps ./tf docker cp tf2-temp-server:/home/steam/serverfiles/tf/materials ./tf docker rm tf2-temp-server
To run the TF2 server using Docker Compose, add the following service configuration to your docker-compose.yml file:
ymlservices: tf2-demo-server: image: ghcr.io/doctor-server/tf2-dedicated-server:latest command: ./srcds_run -console -game tf +sv_pure 1 +randommap +maxplayers 24 ports: - "27015:27015/tcp" - "27015:27015/udp" volumes: - ./tf/cfg:/tf/cfg - ./tf/maps:/tf/maps - ./tf/materials:/tf/materials restart: always tty: true stdin_open: true
slim)First, create a temporary container to copy the necessary server files to your local tf directory:
docker create --name tf2-temp-server ghcr.io/doctor-server/tf2-dedicated-server:slim sleep infinity docker cp tf2-temp-server:/home/steam/serverfiles/tf/cfg ./tf docker cp tf2-temp-server:/home/steam/serverfiles/tf/maps ./tf docker cp tf2-temp-server:/home/steam/serverfiles/tf/materials ./tf docker rm tf2-temp-server
Ensure you add at least one map to the maps folder in your local tf directory.
To run the TF2 server using Docker Compose, add the following service configuration to your docker-compose.yml file:
ymlservices: tf2-demo-server: image: ghcr.io/doctor-server/tf2-dedicated-server:slim command: ./srcds_run -console -game tf +sv_pure 1 +randommap +maxplayers 24 ports: - "27015:27015/tcp" - "27015:27015/udp" volumes: - ./tf/cfg:/tf/cfg - ./tf/maps:/tf/maps - ./tf/materials:/tf/materials restart: always tty: true stdin_open: true
To start the TF2 dedicated server, run the following command:
shdocker compose up -d
To attach to the running container, use:
shdocker attach <container_name>
To detach from the container without stopping it, use the key combination:
Ctrl + P, Ctrl + Q
This section is for github developer
Build the Docker Image
shdocker build -f Dockerfile.buildid -t remote-buildid:232250 --build-arg APP_ID=232250 .
Retrieve the Remote Build ID
Run the following command to get the build ID from the Docker container:
shdocker run --rm remote-buildid:232250 sh -c "cat buildid.txt"
To build the Docker image locally, run the following command:
shdocker build -t tf2-dedicated-server:latest --build-arg remote_buildid=<remote_buildid> --build-arg tag=latest .
shdocker build -t tf2-dedicated-server:slim --build-arg remote_buildid=<remote_buildid> --build-arg tag=slim .
To run the demo TF2 server locally, use Docker Compose:
shdocker compose up -d
To copy the server files to a local directory, use the following command:
docker cp tf2-demo-server:/home/steam/serverfiles/tf ./tf
Successfully copied 11.7GB to C:\GitHub\tf2-dedicated-server\tf
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

来自真实用户的反馈,见证轩辕镜像的优质服务