我正在尝试构建我的第一个docker映像,但我一直收到一个错误,显示为failed to solve with frontend dockerfile.v0: failed to create LLB definition: Dockerfile parse error line 2: FROM requires either one or three arguments
我的docker文件如下所示:
#Pull base image
FROM python: 3.7
#set environment variables
ENV PYTHONDONTWRITEBYCODE 1
ENV PYTHONUNBUFFERED 1
#set work directory
WORKDIR /code
#Install dependencies
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system
# copy project
COPY . /code/对此有什么想法吗?由于某些原因,它似乎没有通过第二行。
发布于 2020-12-01 21:29:07
FROM python: 3.7
由于python:和3.7之间的空格,FROM收到两个参数(python:和3.7),而它需要一个(格式为image:tag)或三个参数(如错误所述)。请参阅docs。
您应该删除空格:
FROM python:3.7
https://stackoverflow.com/questions/65091334
复制相似问题