Skip to content

Building OpenJDK using temurin build scripts within the adopt build docker container

Martijn Verburg edited this page Aug 8, 2022 · 13 revisions
  1. Pull the build docker image for your environment:

For a x64 architecture use docker image: docker pull adoptopenjdk/centos6_build_image

For a arm64 architecture use docker image: docker pull adoptopenjdk/centos7_build_image

  1. Create a local workspace to build in:

mkdir workspace

  1. Start docker container, substitute full .path. to your workspace:

docker run -it -u=$(id -u):$(id -g) -w /.path./workspace -v /.path./workspace:/.path./workspace <image from (1)> bash

Note: If you have SELinux enabled (check with sestatus), then use -v /.path./workspace:/.path./workspace:z

  1. git clone https://github.com/adoptium/temurin-build.git
  2. cd temurin-build
  3. Set the following environment variables, put into a script and source to make easier. Choose settings appropriate to your required arch, target, variant and version to build..:

export ARCHITECTURE=x64

export TARGET_OS=linux

export VARIANT=temurin

export JAVA_TO_BUILD=jdk17u

#export BUILD_ARGS= for any build args

# Set --with-ccache-dir if default ccache location is not writable from the docker contain

#export CONFIGURE_ARGS=--with-ccache-dir=<ccachedir>

  1. Perform build with command:

build-farm/make-adopt-build-farm.sh