注意:这是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 开发、数据科学、机器学习 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务