我正在使用 Visual Studio Code 和 Cloud Code 扩展名。当我尝试“部署到云运行”时,出现此错误:
Automatic image build detection failed. Error: Component map not found. Consider adding a Dockerfile to the workspace and try again.
但是我已经有了一个Dockerfile:
# Python image to use.
FROM python:3.8
# Set the working directory to /app
WORKDIR /app
# copy the requirements file used for dependencies
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Install ptvsd for debugging
RUN pip install ptvsd
# Copy the rest of the working directory contents into the container at /app
COPY . .
# Run app.py when the container launches
ENTRYPOINT ["python", "-m", "ptvsd", "--port", "3000", "--host", "0.0.0.0", "manage.py", "runserver", "--noreload"]
请问如何解决?
最佳答案
我无法重现该问题,但我向Cloud Code团队进行了检查,听起来gcloud可能存在根本问题,这不是你的错。
我认为您不会再看到此错误,但是如果您再次看到此错误,那么可以在Cloud Code VS Code repo上提交问题,这样我们可以收集更多信息并仔细检查,那就太好了。
这确实表明我们需要改进错误消息。我已经提交了一个错误来修复有关这种情况的消息。
关于docker - 自动图像生成检测失败。错误:找不到组件映射。考虑将Dockerfile添加到工作区,然后重试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63887379/