Skip to content

Add docs for image mounts (--mount type=image) - #25486

Merged
dvdksn merged 1 commit into
docker:mainfrom
dvdksn:docs-image-mounts
Aug 3, 2026
Merged

Add docs for image mounts (--mount type=image)#25486
dvdksn merged 1 commit into
docker:mainfrom
dvdksn:docs-image-mounts

Conversation

@dvdksn

@dvdksn dvdksn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds documentation for the image mount storage type (--mount type=image),
which had no dedicated page. New content/manuals/engine/storage/image-mounts.md
follows the same template and depth as the volumes/bind/tmpfs pages, and the
storage overview plus sibling "Next steps" lists are updated to link it.

Written in anticipation of image mounts being unflagged as experimental
(moby/moby#52998), so no experimental callouts are included. Every command and
output on the page was verified against a live Docker Engine 29.6.1 daemon
(containerd image store).

Learnings

  • Image mounts are read-only unconditionally (readonly=false has no effect;
    docker inspect always reports "RW":false), the source image is not
    auto-pulled, there is no -v shorthand, and executables from the mounted
    image only run if the container's libc/dynamic linker matches (a glibc binary
    fails in musl-based Alpine). These are easy to get wrong from the CLI help
    alone — worth verifying against a daemon.

Generated by Claude Code

@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 06c302b
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a475c61ce1b090008f2aa93
😎 Deploy Preview https://deploy-preview-25486--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.

@dvdksn dvdksn added the status/review Pull requests that are ready for review label Jul 3, 2026
@github-actions github-actions Bot added area/engine Issue affects Docker engine/daemon area/storage Relates to storage, volumes labels Jul 3, 2026
@dvdksn
dvdksn requested a review from a team July 3, 2026 06:47

@docker-agent docker-agent 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.

Assessment: 🟢 APPROVE

The PR adds a well-structured new page for --mount type=image, following the same template as the existing volumes/bind-mounts/tmpfs pages. No critical issues found.

What looks good:

  • No vendored files touched; no redirects needed (new page, not a rename)
  • Front matter includes required title, description, keywords fields
  • No AI hedge words or marketing language detected
  • Markdown formatting, Hugo shortcodes, and internal links are correct
  • Commands and examples are consistent with the established patterns in sibling pages

@docker-agent docker-agent 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.

Assessment: 🟡 NEEDS ATTENTION

Comment thread content/manuals/engine/storage/image-mounts.md Outdated
Comment thread content/manuals/engine/storage/image-mounts.md
Document the image mount storage type: a new
content/manuals/engine/storage/image-mounts.md page following the
volumes/bind/tmpfs template, plus overview and cross-link updates in the
storage section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dvdksn
dvdksn force-pushed the docs-image-mounts branch from eaee8fc to 06c302b Compare July 3, 2026 06:53

@vvoland vvoland 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.

LGTM, thanks!

@dvdksn dvdksn added the status/do-not-merge Pull requests that are awaiting some event or decision before they can be merged. label Jul 3, 2026
@dvdksn
dvdksn marked this pull request as ready for review July 3, 2026 19:14

@docker-agent docker-agent 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.

Assessment: 🟡 NEEDS ATTENTION

`type=image`.

```console
$ docker run --mount type=image,src=<image-reference>,dst=<container-path>

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.

[HIGH] docker run syntax examples are missing the required container image argument

Both syntax examples omit the container image positional argument that docker run requires:

$ docker run --mount type=image,src=<image-reference>,dst=<container-path>

Without an image name at the end, this command will fail. Since these are presented as runnable console examples (with a $ prompt), users will copy-paste and get an error. A corrected form would be:

$ docker run --mount type=image,src=<image-reference>,dst=<container-path> <container-image>

The same fix applies to the extended form on line 96.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That example is ambiguous though so maybe using something like:

$ docker run --mount type=image,src=<mounted-image>,dst=<container-path> <runtime-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.

Great suggestion! Using <mounted-image> and <runtime-image> makes the distinction much clearer. The current <image-reference> and <container-path> labeling doesn't help users understand that there are two images involved: the one being mounted as a data source, and the one that's actually running as the container.

Your proposal removes that ambiguity nicely — it's immediately obvious which image is which.


```console
$ docker inspect imgtest --format '{{ json .Mounts }}'
[{"Type":"image","Name":"busybox:musl","Source":"/var/lib/docker/rootfs/overlayfs/...","Destination":"/dbg","Mode":"","RW":false,"Propagation":"rprivate"}]

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.

[LOW] docker inspect example path prefix may not match containerd image store output

The example output shows:

"Source":"/var/lib/docker/rootfs/overlayfs/..."

Image mounts require the containerd image store. The actual source path on a containerd-backed daemon may differ from the /var/lib/docker/rootfs/overlayfs/ prefix shown. Users comparing this to their own docker inspect output could be confused if their path looks different.

Since the value is truncated with ..., it's clearly illustrative — but confirming the path prefix against a live containerd-image-store daemon (as mentioned in the PR description) and using the real prefix would make this more accurate.

@dvdksn dvdksn removed the status/do-not-merge Pull requests that are awaiting some event or decision before they can be merged. label Aug 3, 2026
@dvdksn
dvdksn merged commit 62f6d26 into docker:main Aug 3, 2026
20 checks passed
@dvdksn
dvdksn deleted the docs-image-mounts branch August 3, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon area/storage Relates to storage, volumes status/review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants