Skip to content

[SPARK-55115][INFRA][3.5] Use composable Dockerfile for release builds - #53908

Closed
cloud-fan wants to merge 2 commits into
apache:branch-3.5from
cloud-fan:release-infra-3.5
Closed

[SPARK-55115][INFRA][3.5] Use composable Dockerfile for release builds#53908
cloud-fan wants to merge 2 commits into
apache:branch-3.5from
cloud-fan:release-infra-3.5

Conversation

@cloud-fan

@cloud-fancloud-fan commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR refactors the release Docker image build process to use a composable Dockerfile approach:

  1. Dockerfile.base: A shared base image containing common tools (Ubuntu 22.04, R packages, Ruby/bundler, TeX, Node.js)
  2. Dockerfile: Branch-specific image that extends the base with Java/Python versions and packages for this branch
  3. do-release-docker.sh: Updated to build the base image first, then the branch-specific image

Why are the changes needed?

Currently, each branch maintains its own full Dockerfile which leads to:

  • Duplicated common configuration across branches
  • Difficulty keeping base tools (R packages, Ruby, etc.) in sync
  • Expired GPG keys or outdated base images affecting all branches

With the composable approach:

  • Common tools are defined once in Dockerfile.base
  • Each branch only specifies its unique Java/Python requirements
  • Updates to base tools can be applied consistently

Version changes

ComponentBeforeAfter
Ubuntu20.0422.04 (jammy-20250819)
bundler2.3.82.4.22
R CRAN repofocal-cran40jammy-cran40
docutils<0.17==0.16
FULL_REFRESH_DATE(none)20250819

Note: The Ubuntu upgrade from 20.04 to 22.04 is necessary to use a shared base image across all branches. Ubuntu 20.04 reached end of standard support in April 2025.

Does this PR introduce any user-facing change?

No. This only affects the release infrastructure.

How was this patch tested?

Docker image built and verified successfully on remote machine.

Was this patch authored or co-authored using generative AI tooling?

Yes

@github-actions

Copy link
Copy Markdown

JIRA Issue Information

=== Improvement SPARK-55115 ===
Summary: Use master branch's Dockerfile for release builds
Assignee: None
Status: Open
Affected: ["4.2.0"]


This comment was automatically generated by GitHub Actions

This changes the release Dockerfile to use a composable approach:
- Dockerfile.base: Contains common tools shared across all Spark versions
(Ubuntu 22.04, R packages, Ruby/bundler, TeX, Node.js)
Does NOT include Java or Python - those are branch-specific.
- Dockerfile: Branch-specific configuration that extends the base image
(installs Java, Python, and version-specific pip packages)
For branch-3.5:
- Uses Java 8
- Uses Python 3.8
- Installs Sphinx 3.0.4 and related packages for documentation
The original Dockerfile didn't set JAVA_HOME. The do-release.sh script
has fallback logic that sets JAVA_HOME=/usr which works correctly.
Setting JAVA_HOME in ENV at build time causes architecture mismatch issues.
@cloud-fan

Copy link
Copy Markdown
ContributorAuthor

thanks for review, merging to 3.5!

cloud-fan added a commit that referenced this pull request Jan 23, 2026
### What changes were proposed in this pull request?
This PR refactors the release Docker image build process to use a composable Dockerfile approach:
1. **`Dockerfile.base`**: A shared base image containing common tools (Ubuntu 22.04, R packages, Ruby/bundler, TeX, Node.js)
2. **`Dockerfile`**: Branch-specific image that extends the base with Java/Python versions and packages for this branch
3. **`do-release-docker.sh`**: Updated to build the base image first, then the branch-specific image
### Why are the changes needed?
Currently, each branch maintains its own full Dockerfile which leads to:
- Duplicated common configuration across branches
- Difficulty keeping base tools (R packages, Ruby, etc.) in sync
- Expired GPG keys or outdated base images affecting all branches
With the composable approach:
- Common tools are defined once in `Dockerfile.base`
- Each branch only specifies its unique Java/Python requirements
- Updates to base tools can be applied consistently
### Version changes
| Component | Before | After |
|-----------|--------|-------|
| Ubuntu | 20.04 | 22.04 (jammy-20250819) |
| bundler | 2.3.8 | 2.4.22 |
| R CRAN repo | focal-cran40 | jammy-cran40 |
| docutils | <0.17 | ==0.16 |
| FULL_REFRESH_DATE | (none) | 20250819 |
**Note**: The Ubuntu upgrade from 20.04 to 22.04 is necessary to use a shared base image across all branches. Ubuntu 20.04 reached end of standard support in April 2025.
### Does this PR introduce _any_ user-facing change?
No. This only affects the release infrastructure.
### How was this patch tested?
Docker image built and verified successfully on remote machine.
### Was this patch authored or co-authored using generative AI tooling?
Yes
Closes#53908 from cloud-fan/release-infra-3.5.
Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@cloud-fan@HyukjinKwon