我想实现一个基于Windows的dockerfile,它也可以用来安装python。 这些是我拥有的一些命令,我想对其中显式安装 python 的部分进行故障排除。
# Use Windows Server Core as the base image
FROM mcr.microsoft.com/windows/servercore:ltsc2022
# Install Python 3.12.2
SHELL ["cmd", "/S", "/C"]
# Download and install Python
RUN curl -o python-installer.exe https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe && \
python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 && \
del python-installer.exe
用于 Python 安装的 Dockerfile
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["cmd", "/S", "/C"]
RUN curl -Lo python-installer.exe https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe && ^
python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 && ^
del python-installer.exe
RUN python --version