Home > Blockchain >  Which minor version would be pulled if we don't specify the Docker image version for OpenJDK?
Which minor version would be pulled if we don't specify the Docker image version for OpenJDK?

Time:04-26

If I specify the following base image, which minor version of Java would be pulled?

FROM adoptopenjdk/openjdk11:alpine-jre

Similarly, which minor version would be pulled if I specify the following:

FROM adoptopenjdk/openjdk11-openj9:alpine-jre

Documentation for above images:

  • enter image description here

    CodePudding user response:

    With a "floating" tag like this, it will be whichever the most recent version that's been packaged is.

    It's important to note that docker build and docker run will just use a local image if you have one, so if the image you have locally uses Java 11.0.9 and there's a newer one on Docker Hub with 11.0.11, you'll use the slightly older version. There is a docker build --pull option that does docker pull on every FROM line before building, which will make sure you have the most recent base image.

    Since you can docker run the base image directly, it should be straightforward to figure out what's inside of it

    docker run --rm adoptopenjdk/openjdk11:alpine-jre \
      java -version
    
  • Related