Bind mount
A bind mount makes an existing file or directory accessible at another filesystem location, commonly exposing host contents within a container.
Learn Docker in a Month of Lunches, Second Edition
A local bind mount makes a directory or file from the host filesystem available at a path in a container.
- How it is used
- Shares host directories or files with containers for data access, development, configuration, and selected network-storage workflows.
- How deep it goes
- Explains mounting, bidirectional access, read-only use, directory shadowing, file behavior, and storage limitations across operating systems.
- Examples
- Demonstrates host database persistence, local source-code loading, read-only configuration, and directory-versus-file mount behavior.
- What you can do after
- Operate/configure Docker containers with host-backed directories, verify mounted data, and choose read-only or writable access appropriately.
Read how Learn Docker in a Month of Lunches, Second Edition explains bind mount →
Building Distributed Applications that Work
A bind mount maps a location in the host filesystem to a location in a container filesystem.
- How it is used
- Makes host-managed realm JSON files available inside a Keycloak container during startup.
- How deep it goes
- Defines the mapping and shows its Aspire configuration, startup argument, and build-output requirement without exploring Docker internals.
- Examples
- Maps a local Keycloak folder to /opt/keycloak/data/import through an ImportRealms extension method.
- What you can do after
- Apply it via Aspire’s WithBindMount to supply realm files to Keycloak at startup.
Read how Building Distributed Applications that Work explains bind mount →
Also covered in
- Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more
- Kubernetes for Developers
What to know first
- containerA software container is an isolated execution environment that packages an application and its dependencies, typically sharing the host operating-system kernel.
Related concepts
- file systemuses · A file system is a software-managed structure and set of operations for organizing, naming, storing, and accessing files and directories on storage.
- containeruses · A software container is an isolated execution environment that packages an application and its dependencies, typically sharing the host operating-system kernel.
- Docker Composeused by · Docker Compose is a tool for defining and running applications composed of multiple containers through declarative configuration.
- Podmanused by · Podman is a daemonless, open-source container engine for building, running, and managing containers and container images.
- volumekind of · A volume is a logical storage resource that provides capacity for storing and accessing data, often by making it available to an operating system or application.
Questions about bind mount
What is bind mount?
A bind mount makes an existing file or directory accessible at another filesystem location, commonly exposing host contents within a container.
Which Manning books explain bind mount?
Learn Docker in a Month of Lunches, Second Edition and Building Distributed Applications that Work.
What should I know before learning bind mount?
Manning books that teach bind mount usually introduce container and network-attached storage first.
What is bind mount a kind of?
Bind mount is a kind of volume. A volume is a logical storage resource that provides capacity for storing and accessing data, often by making it available to an operating system or application.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

