Im new to docker and trying to learn it. Im following this tutorial: https://docs.docker.com/get-started/part2/#apppy
So I installed Docker on Windows. Created 3 fil
I forgot to have a whitespace in ENTRYPOINT["java",
It should be ENTRYPOINT ["java",
In Google Cloud Platform in console project using nano the comand work for me
1º-nano
2-
# The Dockerfile defines the image's environment
# Import Python runtime and set up working directory
FROM python:2.7-alpine
WORKDIR /app
ADD . /app
# Install any necessary dependencies
RUN pip install -r requirements.txt
# Open port 80 for serving the webpage
EXPOSE 80
# Run app.py when the container launches
CMD ["python", "app.py"]
save the file...
I just tested the same and by default VSCode seems to save the Dockerfile with UTF-16 LE encoding.
Resaving the file as UTF-8 allowed docker build to run without error.
Solved by removing the dockerfile and creating it with Notepad instead of Visual Code
When doing it from Windows, I had to make sure that I have line breaks in my Dockerfile
configured for Linux (LF
) and not for Windows (CRLF
) when editing it from a text editor.
I experienced this issue when working on a React app setup on Docker.
Sending build context to Docker daemon 1.143MB
Error response from daemon: Dockerfile parse error line 1: unknown instruction: +#
Here's how I solved it
The issue was that I had another file named Dockerfile
(capital case D) which had some instructions in it, and it was conflicting with the original dockerfile
(lower case d) in my project root directory.
I fixed this by deleting the Dockerfile
and running the command:
docker build t myapp:latest .
to build the docker image from the dockerfile
instead.
That's all.
I hope this helps