python winamd64图像和窗户容器

发布于 2025-02-05 03:44:21 字数 720 浏览 1 评论 0原文

我是Docker的新手,想知道是否有纤薄或轻型的Python Winamd64图像? 在Docker文件中,如下所示:

FROM python:3.8-slim-buster

# Create project directory (workdir)
WORKDIR /SMART

# Add requirements.txt to WORKDIR and install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt

# Add source code files to WORKDIR
ADD . .

# Application port (optional)
EXPOSE 8000

# Container start command
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

它在Linux容器状态下运行良好,但是我需要我的容器才能成为Windows。当我将其切换到Windows容器时,即使我将“实验性”更改为真实值,我也会面临问题。因此,我决定使用Python winamd64映像,但是网站上的所有官方图像均约为1 gbyte。我需要一个小型的Python图像,例如(Python:3.8-Slim-Buster),那么我该如何解决这个问题?或者,如何在第一行(从Python:3.8-Slim-Buster)中更改Docker文件以使用我推到轮毂的Python图像?

I am new to Docker and want to know if there is a slim or light-sized Python winamd64 image?
In the Docker file, as follows:

FROM python:3.8-slim-buster

# Create project directory (workdir)
WORKDIR /SMART

# Add requirements.txt to WORKDIR and install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt

# Add source code files to WORKDIR
ADD . .

# Application port (optional)
EXPOSE 8000

# Container start command
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

It works well in the Linux container state, but I need my container to be Windows. I face a problem when I switch it to the Windows container, even if I change "experimental" to the true value. Therefore, I decided to use a Python winamd64 image, but all of the official images on the website are around 1 GByte. I need a small-sized Python image like (python:3.8-slim-buster) so how could I solve this problem? Or how could I change the Docker file in the first line (FROM python:3.8-slim-buster) to use a Python image that I push to my hub?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文