我是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: #
喜欢它不起作用
我不知道为什么它不起作用
最佳答案