gpt4 book ai didi

docker - 来自守护程序 : Dockerfile parse error line 1: unknown instruction: # 的错误响应

转载 作者:IT老高 更新时间:2023-10-28 21:19:37 26 4
gpt4 key购买 nike

我是 docker 新手,正在努力学习它。我正在关注本教程:https://docs.docker.com/get-started/part2/#apppy

所以我在 Windows 上安装了 Docker。创建了 3 个文件,app.py、Dockefile 和 requirements.txt

我的 docker 文件是这样的

# Use an official Python runtime as a parent image
FROM python:2.7-slim

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app

# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 80

# Define environment variable
ENV NAME World
CMD ["python", "app.py"]

当我在 powershell 中运行它时

docker build -t friendlybuild .

但结果是这样的:

Error response from daemon: Dockerfile parse error line 1: unknown instruction: #

好像不行

我不知道为什么它不起作用

最佳答案

我忘记在 ENTRYPOINT["java",

中有一个空格

应该是ENTRYPOINT ["java",

关于docker - 来自守护程序 : Dockerfile parse error line 1: unknown instruction: # 的错误响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49088933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com