What is the proper term for a Docker Compose bind mount that mirrors the host's absolute path?

I’m using a specific mounting pattern in my docker-compose.yml file where I bind mount a local host directory to the exact same absolute path inside the container.

The configuration looks similar to this:

services:
  <example-application>:
    image: <example-application>/<example-application>:SNAPSHOT
    ports:
      - "4440:4440"
    volumes:
      # Mount <example-application> configuration files matching internal structures:
      - ./<example-application>/scripts:/home/<example-application>/scripts
      - ./<example-application>/server/config/realm.properties:/home/<example-application>/server/config/realm.properties:ro
      - ./<example-application>/etc/profile:/home/<example-application>/etc/profile:ro

By doing this, a file located at

./<example-application>/scripts

on my host machine is accessible at the exact same path

/home/<example-application>/scripts

inside the running container. This is incredibly useful for debugging tools and compilers that output absolute paths, as it eliminates the need to translate paths between the host and the container.

It still is just a bind :slight_smile:

Technically, it does not mirror anything. When a container starts it looks up the inodes for volumes using a bind, then mounts the same inode into the provided container path. Thus, host and container point to the same inode, and as such on the same location in the file system and physical storage.