Skip to content

feat: add --no-cache flag to container:push (W-23597904, #1390) - #3840

Open
heroku-johnny wants to merge 3 commits into
mainfrom
W-23597904
Open

feat: add --no-cache flag to container:push (W-23597904, #1390)#3840
heroku-johnny wants to merge 3 commits into
mainfrom
W-23597904

Conversation

@heroku-johnny

Copy link
Copy Markdown
Contributor

Summary

  • Adds --no-cache boolean flag to heroku container:push
  • Passes --no-cache to the underlying docker build command when the flag is set
  • Adds noCache?: boolean to the BuildImageParams type in DockerHelper

Test plan

  • npm run test:file test/unit/lib/container/docker-helper.unit.test.ts — 2 new tests for noCache: true and noCache: false
  • npm run test:file test/unit/commands/container/push.unit.test.ts — 1 new test verifying --no-cache is passed through to buildImage
  • npx eslint src/lib/container/docker-helper.ts src/commands/container/push.ts — no errors

Closes #1390

🤖 Generated with Claude Code

Adds a --no-cache boolean flag to `heroku container:push` that passes
`--no-cache` to the underlying `docker build` command, allowing users to
bypass the Docker layer cache on demand. Resolves GitHub issue #1390.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@heroku-johnny
heroku-johnny requested a review from a team as a code owner July 27, 2026 20:07

@michaelmalave michaelmalave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a comment on user facing text added. Otherwise, code passes. LGTM

app: flags.app({required: true}),
arg: flags.string({description: 'set build-time variables'}),
'context-path': flags.string({description: 'path to use as build context (defaults to Dockerfile dir)'}),
'no-cache': flags.boolean({description: 'do not use cache when building the image'}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

User facing text. Might need CX review

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.

Add way to set docker build to use --no-cache

2 participants