Decouple corepack enable from the runner chmod in the Dockerfile template#53
Merged
chiro-hiro merged 2 commits intoJun 4, 2026
Conversation
…late
The runner-stage chmod command piggybacked corepack enable onto its tail via
a COREPACK_ENABLE template variable whose value was the literal shell operator
" && corepack enable". Embedding a shell operator inside a template variable
coupled shell control flow to templating and left the {{corepack_enable}}
placeholder concatenated directly onto the chmod with no separation boundary.
Emit corepack enable as its own RUN layer instead, via a new generate_corepack_run()
helper and a {{corepack_run}} placeholder. COREPACK_ENABLE now holds only the
command ("corepack enable"), and the runner chmod stands alone. Behaviour is
unchanged: node/next still enable corepack (now in a dedicated RUN), nginx still
emits none.
Closes orochi-network#44
107170a to
e9dc5ba
Compare
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.
Problem
Closes #44.
The runner-stage
chmodinDockerfile.templatechainedcorepack enableonto its tail through a template variable whose value was the literal shell operator" && corepack enable":chmod -R 750 ${RUNNER_WORKDIR}{{corepack_enable}}Embedding a shell operator inside a template variable couples shell control flow to the templating layer, and the
{{corepack_enable}}placeholder was concatenated directly onto thechmodwith no separation boundary. Both previously-open branches independently removed this pattern, which suggests it was recognised as fragile.Fix
corepack enableis now emitted as its ownRUNlayer:COREPACK_ENABLEholds only the command (corepack enable), no shell operator.generate_corepack_run()helper emits a dedicatedRUN corepack enable(with a comment) when the template requires it.{{corepack_run}}multi-line placeholder; the runnerchmodstands alone.{{corepack_enable}}and its perl substitution are removed.Behaviour is unchanged:
node/nextstill enable corepack (now in a clean dedicated layer),nginxstill emits none.Generated
noderunner stage (after)Verification
shellcheck dockerfile.sh— no findings--dry-runfornode,next,nginxall generate valid Dockerfiles; corepack appears as a standaloneRUNfor node/next and is absent for nginx; no stray blank lines