Skip to content

Intro description of a volume does not appear to align with later text #24435

@Kelso-stryd

Description

@Kelso-stryd

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

"By contrast, when you use a volume, a new directory is created within Docker's storage directory on the host machine, and Docker manages that directory's contents."

Makes it sound like the link between the inside of a container and a volume is not native and bidirectional, but managed by docker, which would imply docker is doing some copying as needed to keep things consistent, and that the contents can diverge.

Later on the page

"To create a bind mount, you can use either the --mount or --volume flag."
and
"In general, --mount is preferred. The main difference is that the --mount flag is more explicit and supports all the available options.

If you use --volume to bind-mount a file or directory that does not yet exist on the Docker host, Docker automatically creates the directory on the host for you. It's always created as a directory."

Implies --volume is effectively an alias to --mount with limited functionality, but it will create a directory for you within the container when a mount is established.

Location

https://docs.docker.com/engine/storage/bind-mounts/

Suggestion

I'm more inclined to believe the later text, but the intro language should be corrected to better reflect what's actually going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/fixAgent has opened a PR for this issueagent/triagedAgent has analyzed this issue; verdict in a commentstatus/triageNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions