Docker cimg missing fonts for AdoptOpenJDK and Ubuntu

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:

    description: "Install missing JDK fonts"
      - 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.

Some threads (you’ll need to read most of all of these threads to understand it and to find test cases):

Have you considered opening an issue on the Github repo for this? CircleCI images are open-source. You could create a pull request if the team that works on that is receptive to the idea after opening an issue.