apache / apache/auron

[BUILD] Support multi-JDK versions in Docker images

Open
#2,024 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
241
Avg merge
2d 12h
Merged PRs (30d)
21

Description

## Background

JDK 8 and JDK 11 have reached End of Life (EOL):
- **JDK 8**: EOL in March 2022 (extended support ends in 2030)
- **JDK 11**: EOL in September 2023 (extended support ends in 2026)

Currently, our Docker build environments use different JDK versions and installation methods across different Linux distributions, which creates inconsistency and makes it difficult to test compatibility with newer JDK versions.

### Current State
| Image | JDK Version | Installation Method | Issue |
|-------|-------------|---------------------|-------|
| ubuntu24 | JDK 8 | apt (PPA) | External dependency, EOL version |
| debian11 | JDK 11 | apt | EOL version |
| centos7 | JDK 8 | yum | EOL version |
| rockylinux8 | JDK 8 | dnf | EOL version |
| azurelinux3 | JDK 17 | tdnf (msopenjdk) | Inconsistent with other images |

## Motivation

1. **Future-proofing**: Prepare for migration to JDK 17/21 (LTS versions with active support)
2. **Testing flexibility**: Enable developers to test compatibility across multiple JDK versions without rebuilding images
3. **Consistency**: Standardize JDK installation approach across all Docker environments
4. **Reduce external dependencies**: Remove reliance on distribution-specific package managers and PPAs
5. **Compliance**: Address security and compliance requirements related to EOL software

## Proposed Solution

Implement a unified multi-JDK support approach across all Docker build images using **Eclipse Temurin** binaries. This solution provides flexibility at both **build time** (via build args) and **runtime** (via switching scripts).

### Key Features
- **Install multiple JDK versions** (8, 11, 17, 21) from Eclipse Temurin binaries
- **Flexible build-time configuration** via `JDK_VERSIONS` and `DEFAULT_JDK` build args
- **Default to JDK 8** for backward compatibility (when no build args specified)
- **Runtime switching** via `set-java` utility script
- **Dynamic JAVA_HOME** that updates automatically after switching versions
- **Consistent across all platforms** (Ubuntu, Debian, CentOS, Rocky Linux, Azure Linux)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.