I was trying to build my Docker image for my Gatsby Application. Whenever I run the command docker build . -t gatsbyapp
, it gives me an error:
f
In my case, I had an extra space after "." in context option
docker build -t myapp .[EXTRA_SPACE_HERE]
It was mention before:
Please rename your docker files
to:
from .dockerfile
to .Dockerfile
no extension
and make sure that if you have a .dockerignore
then start with a lowercase d
then in the command line run the following command to create the image.
docker build -t yourapp:yourtag .
For more information please refer to this documentation Dockerizing a React App
If you are using docker desktop, restarting Docker worked for me. Troubleshoot -> Restart