Skip to content

Conversation

@Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Oct 30, 2025

failed release action

https://github.com/ray-project/kuberay/actions/runs/18928357346/job/54039962351

solution

Dockerfile Changes Summary

Root Cause

  • Version conflict: package.json specifies "packageManager": "[email protected]" but node:18-alpine ships with Yarn 1.22.22 by default
  • Build failed because Yarn 1.22.22 detected version mismatch and exited with error

Changes in deps Stage

Before:

RUN if [ -f yarn.lock ]; then yarn --frozen-lockfile;

After:

RUN if [ -f yarn.lock ]; then \
    corepack enable && \
    corepack prepare [email protected] --activate && \
    yarn config set nodeLinker node-modules && \
    yarn install --immutable;

Changes in builder Stage

Before:

RUN if [ -f yarn.lock ]; then yarn run build;

After:

RUN if [ -f yarn.lock ]; then \
    corepack enable && \
    corepack prepare [email protected] --activate && \
    yarn config set nodeLinker node-modules && \
    yarn install --immutable && \
    yarn run build;

Key Modifications

  1. Enable Corepack: corepack enable - Activates Node.js's built-in package manager version controller
  2. Prepare Yarn 4.9.2: corepack prepare [email protected] --activate - Downloads and activates the correct Yarn version
  3. Configure node-modules linker: yarn config set nodeLinker node-modules - Use traditional node_modules instead of PnP (required by Next.js build)
  4. Update flag: Changed --frozen-lockfile--immutable (Yarn 4 standard)
  5. Duplicate setup in builder: Both stages require identical Corepack setup due to Docker multi-stage isolation

Why Each Stage Needs Setup

  • Multi-stage builds reset the environment at each FROM statement
  • COPY --from=deps only transfers files, not environment configuration
  • Each stage must independently activate Corepack + Yarn 4.9.2

Screenshot

image image

@Future-Outlier
Copy link
Member Author

cc @CheyuWu to review, thank you!

@CheyuWu
Copy link
Collaborator

CheyuWu commented Oct 31, 2025

Nice !!! @Future-Outlier, Overall LGTM
Just few questions:

There are three warnings after building the image:

 3 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 48)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 70)
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 74)

should we fixed this time or this will be the following PR

@Future-Outlier
Copy link
Member Author

Nice !!! @Future-Outlier, Overall LGTM Just few questions:

There are three warnings after building the image:

 3 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 48)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 70)
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 74)

should we fixed this time or this will be the following PR

I think it's ok to open a following PR, thank you!

@Future-Outlier
Copy link
Member Author

@CheyuWu do you mind approve this PR? thank you!

@CheyuWu CheyuWu self-requested a review October 31, 2025 14:30
Copy link
Collaborator

@CheyuWu CheyuWu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rueian rueian merged commit 807ba96 into ray-project:master Oct 31, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants