Docker: Build fails with error unknown parent image ID

Viewed 5659

I'm facing intermittent build job failures with the below error.

[0munknown parent image ID sha256:478c35b0xxxxxxxxxxxxxxx
Build step 'Execute shell' marked build as failure
5 Answers

This generally occurs when you simultaneously clean up the docker memory (or someone delete the content of /var/lib/docker/image/overlay2/imagedb/content or run docker system prune at the same time) , so the image you are building unable to locate the parent folder in which image data is present. Make sure this wont be happening at same time and restarts the build.

If you have an image with none name, then you need to remove this and rebuild your container. That's what solved it for me.

Use the --no-cache tag in the build command line.

docker build --no-cache -t dockerimagenew:v1 .

This can be a flake on various machines with shared disk between docker processes, e.g. Buildkite instances. Simply restarting the build worked for me.

I had this same concern when building a docker image. The error message I got is below:

[Docker] ERROR: Failed to create docker image: Could not build image: unknown parent image ID sha256:cc0b3bd844b13a2ebfc6915019a8194538f2d0b41e420b76a20702e985e2a298
ERROR: Build step failed with exception
com.github.dockerjava.api.exception.DockerClientException: Could not build image: unknown parent image ID sha256:cc0b3bd844b13a2ebfc6915019a8194538f2d0b41e420b76a20702e985e2a298

What worked for me was just trying to rebuild the image again, and it worked fine.

That's all.

I hope this helps

Related