Skip to content

docs: clarify distinct purposes of --pull and --no-cache flags#25308

Open
jasdeepbhalla wants to merge 2 commits into
docker:mainfrom
jasdeepbhalla:fix/pull-no-cache-clarify-best-practices
Open

docs: clarify distinct purposes of --pull and --no-cache flags#25308
jasdeepbhalla wants to merge 2 commits into
docker:mainfrom
jasdeepbhalla:fix/pull-no-cache-clarify-best-practices

Conversation

@jasdeepbhalla

Copy link
Copy Markdown
Contributor

Summary

  • In the --pull section: adds that the flag only affects the FROM instruction — cached RUN layers are still reused. This prevents readers from assuming --pull alone gives them fresh dependencies.
  • In the --no-cache section: replaces the "however... doesn't pull a fresh base image" correction with a positive cross-reference to --pull, and reframes the combined usage as two complementary flags rather than a workaround.

Issue

Fixes #25291

@jasdeepbhalla jasdeepbhalla requested a review from dvdksn as a code owner June 8, 2026 21:38
@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit e2dbcb7
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a28c8427b3162000873c206
😎 Deploy Preview https://deploy-preview-25308--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/build Relates to Dockerfiles or docker build command label Jun 8, 2026
Comment on lines 104 to +107
The `--pull` flag forces Docker to check for and download a newer
version of the base image, even if you have a version cached locally.
It only affects the `FROM` instruction — cached `RUN` layers are still
reused.

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.

Addition is redundant: remove it. This entire section talks about base images. RUN layers are not base images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs-scanner] Contradictory guidance on --pull and --no-cache flags

2 participants