Home Explore Blog CI



docker

content/includes/compose/services-volumes.md
2fe024641a580144fa6e1ea4998715e572a738223e931d0200000003000001b7
The `volumes` attribute define mount host paths or named volumes that are accessible by service containers. You can use `volumes` to define multiple types of mounts; `volume`, `bind`, `tmpfs`, or `npipe`. 

If the mount is a host path and is only used by a single service, it can be declared as part of the service
definition. To reuse a volume across multiple services, a named
volume must be declared in the `volumes` top-level element.

Chunks
d3b4707a (1st chunk of `content/includes/compose/services-volumes.md`)
Title: Volumes Attribute in Docker Compose
Summary
The `volumes` attribute in Docker Compose defines mount points for service containers, allowing access to host paths or named volumes. Mounts can be of type `volume`, `bind`, `tmpfs`, or `npipe`. Single-service host path mounts are defined within the service definition, while reusable volumes across multiple services require declaration in the top-level `volumes` element.