After writing dockerfile, you need to create it as an image through the command
Mobaxterm error: unexpected error reading Dockerfile: read /var/lib/docker/tmp/docker-builder314741730/Dockerfile: is a directory
Solution: first enter the dockerfile folder path
cd Dockerfile/