📦Bind Mount
Also known as Docker Bind Mount, Host Mount, Host Folder Mount
A host folder shared straight into a container. Edits on either side show on both.
Think of it like
Think of it like a window between two rooms. What you change on one side shows on the other.
Example
Emma shares her project folder with a Node box. She saves a file in her editor, and the app inside picks up the change.
Why it matters
It ties a container to files you can see and edit. That makes it the usual choice while writing code.
Definition
Example code
bash
docker run -v "$PWD":/app -w /app node:22 node app.jsCommon mistake
Key takeaways
- 1A host folder. Files stay where the host keeps them.
- 2Both ways. A change shows on both sides at once.
- 3For writing code. Volumes suit data on servers.