This image is designed to supercede the legacy CircleCI OpenJDK image, circleci/openjdk
.
cimg/openjdk
is a Docker image created by CircleCI with continuous integration builds in mind.
Each tag contains a version of OpenJDK, the Java Development Kit and any binaries and tools that are required for builds to complete successfully in a CircleCI environment.
This image can be used with the CircleCI docker
executor.
For example:
1
2
3
4
5
6
7
jobs:
build:
docker:
- image: cimg/openjdk:23.0.1
steps:
- checkout
- run: java --version
In the above example, the CircleCI OpenJDK Docker image is used for the primary container.
More specifically, the tag 23.0.1
is used meaning the version of OpenJDK will be v23.0.1.
You can now use OpenJDK within the steps for this job.
This image contains the Java programming language packaged as OpenJDK by AdoptOpenJDK.
This image has the following tagging scheme:
cimg/openjdk:<openjdk-version>[-variant]
<openjdk-version>
- The version of OpenJDK to use.
This can be a full SemVer point release (such as 11.0.2
) or just the minor release (such as 11.0
).
If you use the minor release tag, it will automatically point to future patch updates as they are released by AdoptOpenJDK & Oracle.
For example, the tag 11.0
points to OpenJDK v11.0.5 now, but when the next release comes out, it will point to OpenJDK v11.0.6.
[-variant]
- Variant tags, if available, can optionally be used.
For example, the Node.js variant could be used like this: cimg/openjdk:14.0-node
.
Variant images typically contain the same base software, but with a few additional modifications.
The Node.js variant is the same OpenJDK image but with Node.js also installed.
The Node.js variant can be used by appending -node
to the end of an existing cimg/openjdk
tag.
1
2
3
4
5
6
7
8
jobs:
build:
docker:
- image: cimg/openjdk:23.0.1-node
steps:
- checkout
- run: java --version
- run: node --version
The browsers variant is the same OpenJDK image but with Node.js, Selenium, and browser dependencies pre-installed via apt.
The browsers variant can be used by appending -browser
to the end of an existing cimg/openjdk
tag.
The browsers variant is designed to work in conjunction with the CircleCI Browser Tools orb.
You can use the orb to install a version of Google Chrome and/or Firefox into your build. The image contains all of the supporting tools needed to use both the browser and its driver.
1
2
3
4
5
6
7
8
9
10
11
12
13
orbs:
browser-tools: circleci/browser-tools@1.1
jobs:
build:
docker:
- image: cimg/openjdk:1.14-browsers
steps:
- browser-tools/install-browser-tools
- checkout
- run: |
node --version
java --version
google-chrome --version