CircleCI-Public / cimg-openjdk

The CircleCI OpenJDK (Java) Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/openjdk
MIT License
18 stars 25 forks source link

Add missing fonts to cimg/openjdk #63

Closed jodastephen closed 3 years ago

jodastephen commented 3 years ago

We are migrating to use the new cimg/openjdk-11.0 docker image. We found that AdoptOpenJDK does not contain the correct setup for fonts, which is needed for various Apache POI operations (and no doubt other use cases). This causes a NullPointerException in our tests.

We solved the problem by adding the following to the config.yml:

  install_fonts:
    description: "Install missing JDK fonts"
    steps:
      - run:
          name: Installing JDK fonts
          command: |
            sudo apt-get -y -qq update || sudo apt-get -y -qq update
            sudo apt-get -y -qq install fontconfig

In our view, since AdoptOpenJDK is not going to be changed, the correct place to fix this is in the definition of the docker image. Can cimg/openjdk be changed to always include the fonts, ie. the equivalent of the lines above. (I don't have enough docker knowledge to raise a PR).

Some threads (you’ll need to read most of all of these threads to understand it and to find test cases): https://github.com/AdoptOpenJDK/openjdk-build/issues/693 https://github.com/AdoptOpenJDK/openjdk-support/issues/70#issuecomment-705635478

FelicianoTech commented 3 years ago

Thanks for opening this issue. When you say you're migrating to this image, are you doing so for the legacy OpenJDK image (circleci/openjdk) or something else?

jodastephen commented 3 years ago

Yes, from the legacy circleci/openjdk image

FelicianoTech commented 3 years ago

Great. This request makes sense to me, I'll work on it. Keep in mind, the way next-gen images work, you'l won't see this change hit the cimg/openjdk images until a new OpenJDK release comes out.

I'll keep you informed when it's available.

FelicianoTech commented 3 years ago

Three new releases are publishing right now and will be available shortly. All three will have the fontconfig package pre-installed: