dockerfile build时报错

报错:

Dockerfile 文件如下:
(该文件可在vs code中使用插件生成,非常方便)

# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-slim-buster

EXPOSE 5000

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# Install pip requirements
COPY requirements.txt .
RUN python -m pip install -r requirements.txt

WORKDIR /app
COPY . /app

# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN useradd appuser && chown -R appuser /app
USER appuser

# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]

运行docker build命令:docker build -t flask_image:latest .
产生报错:

(try_django) PS D:\Users\kate\Work\try\flask_site> docker build -t flask_image:latest .

Sending build context to Docker daemon  5.632kB
Step 1/11 : FROM python:3.8-slim-buster
3.8-slim-buster: Pulling from library/python
no matching manifest for windows/amd64 10.0.18362 in the manifest list entrie

解决方法:

右下角docker小图标,右键点击,再点击“Switch to Linux Contianers…”

不过,切换时windows提醒我升级 WSL 1 到 WSL 2.(跳转到windows官方页面,按照指示在powershell中一通操作,成功升级后就okay了)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值