
如果你使用 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://hub.docker.com/_/python%E7%9A%84%60windows-amd64%60%E6%9E%B6%E6%9E%84%E6%9E%84%E5%BB%BA%E7%9A%84%E2%80%9C%E6%8C%89%E6%9E%B6%E6%9E%84%E2%80%9D%E4%BB%93%E5%BA%93%E2%80%94%E2%80%94%E6%9B%B4%E5%A4%9A%E4%BF%A1%E6%81%AF%EF%BC%8C%E8%AF%B7%E5%8F%82%E8%A7%81%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8F%E6%96%87%E6%A1%A3%E4%B8%AD%E7%9A%84%E2%80%9Chttps://github.com/docker-library/official-images#architectures-other-than-amd64%E2%80%9D%E5%92%8C%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8FFAQ%E4%B8%AD%E7%9A%84%E2%80%9Chttps://github.com/docker-library/faq#an-images-source-changed-in-git-now-what%E2%80%9D%E3%80%82
维护者:
https://github.com/docker-library/python
获取帮助:
Docker社区Slack、Server Fault、Unix & Linux或Stack Overflow
Dockerfile链接(参见FAQ中的“https://github.com/docker-library/faq#whats-the-difference-between-shared-and-simple-tags%E2%80%9D%EF%BC%89
https://github.com/docker-library/python/blob/303456576fd52b3e000639d5cfdf384442e730d7/3.15-rc/windows/windowsservercore-ltsc2025/Dockerfile
https://github.com/docker-library/python/blob/303456576fd52b3e000639d5cfdf384442e730d7/3.15-rc/windows/windowsservercore-ltsc2022/Dockerfile
https://github.com/docker-library/python/blob/e7f6a1c7956a24dc1746d4580ed5961547016a01/3.14/windows/windowsservercore-ltsc2025/Dockerfile
https://github.com/docker-library/python/blob/e7f6a1c7956a24dc1746d4580ed5961547016a01/3.14/windows/windowsservercore-ltsc2022/Dockerfile
https://github.com/docker-library/python/blob/3f2d7e4c339ab883455b81a873519f1d0f2cd80a/3.13/windows/windowsservercore-ltsc2025/Dockerfile
https://github.com/docker-library/python/blob/3f2d7e4c339ab883455b81a873519f1d0f2cd80a/3.13/windows/windowsservercore-ltsc2022/Dockerfile
3.15.0a1, 3.15-rc:
3.15.0a1-windowsservercore, 3.15-rc-windowsservercore:
3.14.0, 3.14, 3, latest:
3.14.0-windowsservercore, 3.14-windowsservercore, 3-windowsservercore, windowsservercore:
3.13.9, 3.13:
3.13.9-windowsservercore, 3.13-windowsservercore:
问题反馈地址:
https://github.com/docker-library/python/issues?q=
支持的架构:(https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/python/, https://hub.docker.com/r/arm32v5/python/, https://hub.docker.com/r/arm32v6/python/, https://hub.docker.com/r/arm32v7/python/, https://hub.docker.com/r/arm64v8/python/, https://hub.docker.com/r/i386/python/, https://hub.docker.com/r/mips64le/python/, https://hub.docker.com/r/ppc64le/python/, https://hub.docker.com/r/riscv64/python/, https://hub.docker.com/r/s390x/python/, https://hub.docker.com/r/winamd64/python/
镜像 artifact 详情:
https://github.com/docker-library/repo-info/blob/master/repos/python (https://github.com/docker-library/repo-info/commits/master/repos/python)
(镜像元数据、传输大小等)
镜像更新:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fpython
https://github.com/docker-library/official-images/blob/master/library/python (https://github.com/docker-library/official-images/commits/master/library/python)
本文档来源:
https://github.com/docker-library/docs/tree/master/python (https://github.com/docker-library/docs/commits/master/python)
Python是一种解释型、交互式、面向对象的开源编程语言。它集成了模块、异常处理、动态类型、非常高级的动态数据类型和类。Python将强大的功能与清晰的语法相结合。它具有许多系统调用和库的接口,以及各种窗口系统的接口,并且可以用C或C++扩展。它也可用作需要可编程接口的应用程序的扩展语言。最后,Python是可移植的:它可以在许多Unix变体、Mac以及Windows 2000及更高版本上运行。
***.org/wiki/Python_(programming_language)
!https://raw.githubusercontent.com/docker-library/docs/01c***b2fe592c1f93a13b4e289ada0e3a1/python/logo.png
DockerfiledockerfileFROM winamd64/python:3 WORKDIR /usr/src/app COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD [ "python", "./your-daemon-or-script.py" ]
或者(如果需要使用 Python 2):
dockerfileFROM winamd64/python:2 WORKDIR /usr/src/app COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD [ "python", "./your-daemon-or-script.py" ]
然后可以构建并运行 Docker 镜像:
console$ docker build -t my-python-app . $ docker run -it --rm --name my-running-app my-python-app
对于许多简单的单文件项目,编写完整的 Dockerfile 可能不方便。在这种情况下,可以直接使用 Python Docker 镜像运行 Python 脚本:
console$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp winamd64/python:3 python your-daemon-or-script.py
或者(同样,如果需要使用 Python 2):
console$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp winamd64/python:2 python your-daemon-or-script.py
在非 slim 变体中,除了镜像提供的 /usr/local/bin/python(默认在 $PATH 中)外,还会有一个额外的(发行版提供的)python 可执行文件位于 /usr/bin/python(和/或 /usr/bin/python3)。这是在非 slim 变体中使用 buildpack-deps 镜像的一个意外副作用(许多发行版提供的工具是基于该 Python 版本编写的,若替换可能导致工具失效,因此无法安全地删除/覆盖它)。
winamd64/python 镜像有多种版本,每种版本设计用于特定场景。
winamd64/python:<version>这是默认镜像。如果不确定需求,建议使用此版本。它既可以用作临时容器(挂载源代码并启动容器以运行应用),也可以作为构建其他镜像的基础。
此标签基于 https://hub.docker.com/_/buildpack-deps/%E3%80%82%60buildpack-deps%60 专为拥有多个镜像的普通 Docker 用户设计,它包含大量非常常见的 Debian 软件包,减少了衍生镜像需要安装的软件包数量,从而减小系统中所有镜像的总体大小。
winamd64/python:<version>-windowsservercore此镜像基于 https://hub.docker.com/r/microsoft/windows-servercore%E3%80%82%E5%9B%A0%E6%AD%A4%EF%BC%8C%E5%AE%83%E4%BB%85%E5%9C%A8%E6%94%AF%E6%8C%81%E8%AF%A5%E5%9F%BA%E7%A1%80%E9%95%9C%E5%83%8F%E7%9A%84%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%B7%A5%E4%BD%9C%EF%BC%8C%E4%BE%8B%E5%A6%82 Windows 10 专业版/企业版(周年更新)或 Windows Server 2016。
有关如何在 Windows 上运行 Docker 的信息,请参见 Microsoft 提供的相关“快速入门”指南:
查看 Python 2 和 Python 3 的许可证信息。
与所有 Docker 镜像一样,本镜像可能还包含其他软件,这些软件可能具有其他许可证(例如基础发行版中的 Bash 等,以及主软件的任何直接或间接依赖项)。
部分能够自动检测到的额外许可证信息可能位于 https://github.com/docker-library/repo-info/tree/master/repos/python%E4%B8%AD%E3%80%82
对于任何预构建镜像的使用,镜像用户有责任确保对本镜像的任何使用都符合其中包含的所有软件的相关许可证。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 winamd64/python 相关的常用 Docker 镜像,适用于 Web 开发、数据科学、机器学习 等不同场景: