Search code examples
dockerapache-sparkdockerfilewindows-subsystem-for-linuxbitnami

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 https://repo1.maven.org/maven2/com/databricks/spark-xml_2.12/0.13.0/spark-xml_2.12-0.13.0.jar --output /opt/bitnami/spark/jars/spark-xml_2.10-0.2.0.jar
ENV PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH

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 docker.io/bitnami/spark:latest                                             31.8s
------
 > [internal] load metadata for docker.io/bitnami/spark:latest:
------
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 "https://auth.docker.io/token?scope=repository%3Abitnami%2Fspark%3Apull&service=registry.docker.io": 
dial tcp 54.85.56.253:443: i/o timeout

Solution

  • Restarting docker helped me to fix this.