Search code examples
dockerdockerfile

Cant create image/ the Dockerfile (Dockerfile) cannot be empty


I am taking a beginner course and not able to create an image on terminal.

Here is the course I am taking(Sorry, the course is in Japanese course but just for the reference). I am at 1:01:39 where he proceeds to create docker image.

First, the error message contained Failed to solve with frontend docker file.v0:failed to create LLB definition:the Dockerfile cannot be empty

I ran below command and managed to get rid of Failed to solve with frontend docker file.v0:failed to create LLB definition (Failed To Resolve With FrontEnd DockerFIle.v0):

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

Now I'm left with the Dockerfile cannot be empty

I saw in some page that people fail to locate because of not capitalized dockerfile but that's not my case.

enter image description here

I have also tried -f on the command to direct file

enter image description here


Solution

  • I saw that you, don't save your dockerfile, try save changes and run docker build again.

    Also saw same issue on github, it could be helpful

    Try to change COPY to ADD

    https://github.com/docker/compose/issues/5170