<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp" -->

---
title: Access Version Controlled Configuration from a Docker...
description: Bind mounting, not symlinking, solves the problem of using version-controlled config files inside Docker containers. The author had been duplicating config...
canonical: https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Access Version Controlled Configuration from a Docker Container | daily.dev
og:description: Bind mounting, not symlinking, solves the problem of using version-controlled config files inside Docker containers. The author had been duplicating config...
og:url: https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp
og:image: https://api.daily.dev/og/posts/ztOv7L4Bp.png
og:image:alt: Access Version Controlled Configuration from a Docker Container
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Access Version Controlled Configuration from a Docker Container

**[Atomic Spin](https://daily.dev/sources/atomicobject)** · 3 min read · 0 upvotes · 0 comments

## Summary

Bind mounting, not symlinking, solves the problem of using version-controlled config files inside Docker containers. The author had been duplicating config files between a homelab git repo and a separate service-data directory because symlinks between them failed inside containers, due to different path mappings. The fix is to bind mount the config file directly from the homelab directory into the container. A docker-compose example mounts Gatus's config.yaml from HOMELAB_DIR alongside a writable data volume from SERVICE_DATA_DIR.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://spin.atomicobject.com/accessing-your-version-controlled-configuration-from-a-docker-container>

## Questions this post answers

### why don't symlinks work when I mount a config directory into a Docker container

Symlinks fail inside Docker containers because the path mappings differ between the host and the container, so a symlink pointing to a host path doesn't resolve correctly once it's inside the container's filesystem. The fix is to bind mount the actual source file or directory directly into the container instead of relying on a symlink.

_Anyone wiring up version-controlled configs in Docker Compose can compare approaches like this on daily.dev._

### how do I mount a version-controlled config file into a Docker Compose service without duplicating it

Bind mount the file directly from its git-tracked location into the container path, marking it read-only if the app shouldn't modify it. For example, a Gatus service mounts '${HOMELAB_DIR}/gatus/config/config.yaml:/config/config.yaml:ro' for configuration while a separate '${SERVICE_DATA_DIR}/gatus/data:/data' volume handles writable application data.

_Developers tidying up homelab or self-hosted Compose setups can find patterns like this on daily.dev._

## Similar posts on daily.dev

- [Docker hides your Jellyfin files, and you'll need to find them the hard way](https://daily.dev/posts/docker-hides-your-jellyfin-files-and-you-ll-need-to-find-them-the-hard-way-s41f7ww82) · XDA Developers · 0 upvotes · 0 comments
- [Docker Compose gave me back my NAS by making it predictable again](https://daily.dev/posts/docker-compose-gave-me-back-my-nas-by-making-it-predictable-again-eact1o3nr) · XDA Developers · 1 upvotes · 0 comments
- [When read-only mounts in Docker Sandboxes become writable](https://daily.dev/posts/when-read-only-mounts-in-docker-sandboxes-become-writable-ikkwnaofd) · Aikido Security · 2 upvotes · 0 comments
- [Running the Azure CLI in a Container](https://daily.dev/posts/running-the-azure-cli-in-a-container-2yvmvp0c3) · Scott's Weblog · 1 upvotes · 0 comments
- [Introduction to Docker Compose](https://daily.dev/posts/introduction-to-docker-compose-auqwyajlu) · Flavio Copes · 11 upvotes · 0 comments

---

Tags: [#docker](https://daily.dev/tags/docker), [#version-control](https://daily.dev/tags/version-control), [#homelab](https://daily.dev/tags/homelab), [#docker-compose](https://daily.dev/tags/docker-compose)

[View this post on daily.dev](https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Access Version Controlled Configuration from a Docker Container","url":"https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp"},"datePublished":"2026-10-26T12:09:04.406Z","dateModified":"2026-10-26T12:17:58.007Z","description":"Bind mounting, not symlinking, solves the problem of using version-controlled config files inside Docker containers. The author had been duplicating config...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"Atomic Spin","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Atomic Spin","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/e2af5ce3adaa403a8cf029268b62419f","url":"https://daily.dev/sources/atomicobject"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"docker,version-control,homelab,docker-compose","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Atomic Spin","item":"https://daily.dev/sources/atomicobject"},{"@type":"ListItem","position":3,"name":"Access Version Controlled Configuration from a Docker Container"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/access-version-controlled-configuration-from-a-docker-container-ztov7l4bp#faq","mainEntity":[{"@type":"Question","name":"why don't symlinks work when I mount a config directory into a Docker container","acceptedAnswer":{"@type":"Answer","text":"Symlinks fail inside Docker containers because the path mappings differ between the host and the container, so a symlink pointing to a host path doesn't resolve correctly once it's inside the container's filesystem. The fix is to bind mount the actual source file or directory directly into the container instead of relying on a symlink. Anyone wiring up version-controlled configs in Docker Compose can compare approaches like this on daily.dev."}},{"@type":"Question","name":"how do I mount a version-controlled config file into a Docker Compose service without duplicating it","acceptedAnswer":{"@type":"Answer","text":"Bind mount the file directly from its git-tracked location into the container path, marking it read-only if the app shouldn't modify it. For example, a Gatus service mounts '${HOMELAB_DIR}/gatus/config/config.yaml:/config/config.yaml:ro' for configuration while a separate '${SERVICE_DATA_DIR}/gatus/data:/data' volume handles writable application data. Developers tidying up homelab or self-hosted Compose setups can find patterns like this on daily.dev."}}]}
```

