Reputation:
I'm following this (https://docs.docker.com/language/java/build-images/ )tutorial from the official website and for some reason the command doker build
always gives me this problem.
I created new Folder in Desktop.
inside of it i created file that called Dockerfile
, and another file that called .dockerignore
as in the tutorial. then i opened the cmd in the same folder and try to run the command: docker build .
, docker build --tag java-docker .
, docker build -t java-docker .
, docker build -t java-docker -f Dockerfile .
but i always get this failure message
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount511906494/Dockerfile: no such file or directory
what I'm missing and doing wrong?
Upvotes: 0
Views: 909
Reputation: 45
If you are on the Windows system, check if the name of Dockerfile has no extension.
Also, check that you are in the right folder before running the command line:
docker build -t java-docker .
Upvotes: 0