Building docker image failing when loading metadata

Im trying to create a docker image using my Dockerfile. I have no prior experience with Docker so I cant really decribe the problem better. I was able to do this yesterday without problems, but I deleted the image and now I cant recreate it.

My Dockerfile

FROM bitnami/spark

USER root
RUN pip install unidecode
RUN curl --output /opt/bitnami/spark/jars/spark-xml_2.10-0.2.0.jar

Im trying to create docker image by this command docker build -t imagename .
I am in the same directory as Dockerfile, so thats not the issue.

This is the output I get when I run the command above.

[+] Building 32.0s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 38B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => ERROR [internal] load metadata for                                             31.8s
 > [internal] load metadata for
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: 
rpc error: code = Unknown desc = failed to fetch anonymous token: 
Get "": 
dial tcp i/o timeout

Source: Docker Questions