build: align Dockerfile pnpm with packageManager via corepack - #13
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto
PR #12 pineo pnpm 9.15.9 via
packageManagerenpackage.json(ya en main). El Dockerfile sin embargo instalaba pnpm por otro mecanismo:RUN npm install -g pnpm@9Esto instala la ultima 9.x flotante en el momento del build, no la 9.15.9 pineada → divergencia imagen vs repo: la imagen podia usar una minor/patch distinta de la que genero
pnpm-lock.yamly la que usa CI.Fix
Reemplazado por corepack (incluido en
node:22-slim, corepack 0.34.x), de forma que la version viene unicamente depackageManagerenpackage.json— ninguna version hardcodeada en el Dockerfile:corepack enable pnpmcrea el shim; el shim resuelve la version exacta desdepackageManagerdelpackage.jsoncopiado.RUN pnpm --versiontras el COPY sirve de fail-fast y hace visible la version resuelta en el log de build.COREPACK_ENABLE_DOWNLOAD_PROMPT=0evita prompts interactivos (no-op en build no-TTY, defensivo).Unica fuente de verdad: bump de pnpm = tocar solo
packageManager(viacorepack use), imagen y CI siguen automaticamente.Verificacion (AC real, ejecutada)
docker build --no-cache -t amc-pnpm-corepack-verify .→ EXIT=0, build completo (Next.js build + export de imagen OK).#10 [ 6/10] RUN pnpm --version→9.15.9.pnpm install --frozen-lockfileejecutado conDone in 22.6s using pnpm v9.15.9.docker run --rm amc-pnpm-corepack-verify pnpm --version→9.15.9.Scope
Solo
Dockerfile. Sin cambios en otros ficheros. Card ded42f4d (hija de de29e8f8).