0

I am a complete noob to Docker, I apologize if this a simple question, I seem to have a significant installation/configuration error in Docker. I am working on a fresh install of Ubuntu 20.04 and Docker version 20.10.12, build e91ed57.

I am literally trying to follow the basic Docker tutorial for beginners from their website and the second command is not working.

The tutorial is no big deal, I can switch tutorials to something more up to date, but it seems that key functionality of Docker is not working correctly.. symlinks.

This command docker build -t getting-started . results in this error:

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/<user>/Downloads/WebDev/Docker/tutorial/getting-started-master/app/Dockerfile: no such file or directory

I double & triple checked everything. I literally tried every solution found here:
Docker: unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx
Docker build gives "unable to prepare context: context must be a directory: /Users/tempUser/git/docker/Dockerfile"

Nothing worked. I could only execute the command using an explicit path. rather than "." which is going to get annoying pretty quickly when developing real projects.

docker build -t getting-started ~/Downloads/WebDev/Docker/tutorial/getting-started-master/

All documentation states docker build -t getting-started . is the correct command, so I am worried about continuing with a "broken" docker installation.

I ran the docker ./check-config.sh script and it shows all is well except CONFIG_RT_GROUP_SCHED: missing which I thought was inconsequential for the moment since hello-world image worked as expected.

Hhhmmm?

B-zaro
  • 205
  • 1
  • 14

1 Answers1

1

What directory are you in when running these commands? From your error it seems you are in the /app directory, whilst you should probably be 1 directory up. Or, alternatively, your dockerfile is 1 directory below where it was intended to be. I draw this conclusion by comparing the 2 paths you mention:

~/Downloads/WebDev/Docker/tutorial/getting-started-master/app/Dockerfile

vs

~/Downloads/WebDev/Docker/tutorial/getting-started-master/

If the second one works, then the dockerfile is under getting-started-master and not under /app.

Fyi: Docker has a context and unless you explicitly specify it to be something different, by default it's going to be the directory the Dockerfile is located in.

JustLudo
  • 1,690
  • 12
  • 29
  • 1
    Appreciate the reply. You helped me see a silly "user error"... after extracting the zip for the tutorial, I didn't change the name of the extracted directory from "getting-started-master" to "getting-started", hence `docker build -t getting-started .` command got thrown off. Simple mistake, I wish they mentioned. oh well.. thanks. Let the learning continue. :-) – B-zaro Feb 03 '22 at 11:48
  • Glad to have helped you in that respect. Learning is essentially the process of making mistakes in order to do things better next time, so it was a good lesson :) . – JustLudo Feb 03 '22 at 12:07