I installed docker on Ubuntu with snap (snappy?), and then I ran this:
ln -sf /usr/bin/snap /usr/local/bin/docker
when I run docker build I get:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /var/lib/snapd/void/Dockerfile: no such file ordirectory
I've got the same error using Ubuntu, and I noticed that I had installed the wrong Docker. Instead of (docker - transitional package) install (docker.io - Linux container runtime)
apt install docker.io
I ran into this same problem. I was setting up an Ubuntu server and elected to have Docker installed during the initial setup. It installed using snap, and as a result I couldn't run Docker in any directory outside of my home directory. This includes trying to Docker run any program in /var/. I fixed it by doing sudo snap remove docker and reinstalled using the official instructions in the Ubuntu docs:
I got this exact error message when I was running in /tmp/foo. When I switched the directory to /home/me/tmp/foo, The error went away.