Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Docker build fails to resolve the openjdk slim-buster base image

Errorfailed to resolve source metadata for docker.io/library/openjdk:21-slim-buster

Short answer

The tag you named does not exist any more. The openjdk image on Docker Hub is officially deprecated and only lists a few early-access tags, and Debian 10 buster is out of support. Pick a maintained Java image such as eclipse-temurin and a current base, then rebuild.

  • Applies to Docker Engine 28, BuildKit, Java 21
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the registry about the exact tag. If it cannot be inspected, the tag is gone and no Docker setting will bring it back.

    docker buildx imagetools inspect openjdk:21-slim-buster
  2. 2Match what you see, then jump to its fix

    1. 1The same error for any openjdk tag that is not in the short list on Docker HubThe openjdk image is deprecated and has no such tagFix
    2. 2Tag name ends in -buster; other tags of the same image resolve fineThe tag is built on Debian buster, which is no longer supportedFix

What does the error look like?

  • failed to resolve source metadata for docker.io/library/openjdk:21-slim-buster

Cause 1 of 2

The openjdk image is deprecated and has no such tag

1Check

Docker Hub marks openjdk as officially deprecated and says only Early Access tags are still updated. Open its tag list and look for your tag.

docker buildx imagetools inspect openjdk:21-slim

2Fix

Change FROM to a maintained Java image. Docker Hub's own notice lists amazoncorretto, eclipse-temurin, ibm-semeru-runtimes, ibmjava and sapmachine.

# before
FROM openjdk:21-slim-buster
# after
FROM eclipse-temurin:21

3Verify

The base image resolves and the build starts.

docker build -t my-java-app .

Confirmed by hub.docker.com

Did this fix it?

Cause 2 of 2

The tag is built on Debian buster, which is no longer supported

1Check

Debian 10 (buster) got its last security updates under LTS on 30 June 2024, and Debian points users to a newer release.

docker buildx imagetools inspect eclipse-temurin:21

2Fix

Move to a base image built on a supported release. The eclipse-temurin default image is Ubuntu based, with tags named after the suite, and an -alpine variant is also offered.

FROM eclipse-temurin:21-alpine
# or, for a Debian/Ubuntu-style base:
# FROM eclipse-temurin:21

3Verify

Run the new image and print the Java version.

docker run --rm eclipse-temurin:21 java -version

Confirmed by debian.org

Did this fix it?

How do I stop it coming back?

  • Avoid base tags that name an old OS release; check the tag list of your base image when you upgrade Java.
  • Pin to a major version of a maintained image, and read the deprecation notice on Docker Hub before choosing one.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.