unable to evaluate symlinks in Dockerfile path: lstat <path> no such file or directory

Viewed 10242

I'm trying to run tacotron2 on docker within Ubuntu WSL2 (v.20.04) on Win10 2004 build. Docker is installed and running and I can run hello world successfully.

(There's a nearly identical question here, but nobody has answered it.)

When I try to run docker build -t tacotron-2_image docker/ I get the error:

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/nate/docker/Dockerfile: no such file or directory

So then I navigated in bash to where docker is installed (/var/lib/docker) and tried to run it there, and got the same error. In both cases I created a docker directory, but kept getting that error in all cases.

How can I get this to work?

3 Answers

As mentioned here, the error might have nothing to do with "symlinks", and everything with the lack of Dockerfile, which should be in the Tacotron-2/docker folder.

docker build does mention:

The docker build command builds Docker images from a Dockerfile and a “context”.
A build’s context is the set of files located in the specified PATH or URL.

In your case, docker build -t tacotron-2_image docker/ is supposed to be executed in the path you have cloned the Rayhane-mamah/Tacotron-2 repository.

To be sure, you could specify said Dockerfile, but that should not be needed:

docker build -t tacotron-2_image -f docker/Dockerfile docker/

Or:

cd
git clone https://github.com/Rayhane-mamah/Tacotron-2
cd Tacotron-2
cd docker
docker build -t tacotron-2_image .

I thought these commands I'm executing are for the purpose of installing it

To build the image, you need the sources (the repository to clone).

If the name of you Dockerfile is with capital F rename it

For others like me who somehow couldn't get it works because of symlink

just copy out your files out to a new directory that hasn't been symlink and build your image from there

if ony if you've confirm that your Dockerfile isn't dockerfile .Dockerfile ,DockerFile or dockerfile.txt .

My OS elementary which is base on ubuntu.

Related