This is the toml configuration and this file exist /git/homeserver/docker-compose/dockge/docker-compose.yml
stack
name = "dockge"
tags = ["stack"]
[stack.config]
server = "unraid"
destroy_before_deploy = true
files_on_host = true
file_paths = ["docker-compose.yml"]
The thing is yesterday it was working, I added the stacks and I could deploy and stop them several times, and today for some reason (I have change anything) it looks like it doesn't have access to the files anymore, none of my stacks works I get this error If I try to deploy them
ERROR: Failed to validate run directory on host after stack write (canonicalize error)
TRACE:
1: No such file or directory (os error 2)
This is my full docker compose
###############################################################
# Komodo - Docker Management
###############################################################
# Common settings #############################################
x-default: &config
restart: unless-stopped
cpuset: 10,22,11,23
security_opt:
- no-new-privileges:true
dns:
- ${dns50}
x-labels: &labels
com.centurylinklabs.watchtower.enable: "true"
net.unraid.docker.managed: "composeman"
net.unraid.docker.shell: "sh"
# Services ####################################################
services:
# Komodo ######################################################
komodo:
container_name: ${komodo_name}
image: ghcr.io/mbecker20/komodo:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
<<: *config
env_file: .env
depends_on:
- mongodb
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
eth1:
ipv4_address: ${komodo_ip}
komodo-net:
ports:
- 9120:9120
volumes:
## Core cache for repos for latest commit hash / contents
- ${dockerdir}/Komodo/repo-cache:/repo-cache
## Store sync files on server
- ${dockerdir}/Komodo/syncs:/syncs
## Optionally mount a custom core.config.toml
# - /path/to/core.config.toml:/config/config.toml
## Allows for systemd Periphery connection at
## "http://host.docker.internal:8120"
# extra_hosts:
# - host.docker.internal:host-gateway
## Deploy Periphery container using this block,
## or deploy the Periphery binary with systemd using
## https://github.com/mbecker20/komodo/tree/main/scripts
environment:
KOMODO_DATABASE_ADDRESS: mongodb:27017
KOMODO_DATABASE_USERNAME: ${DB_USERNAME}
KOMODO_DATABASE_PASSWORD: ${DB_PASSWORD}
labels:
<<: *labels
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
net.unraid.docker.icon: "https://komo.do/img/logo512.png"
net.unraid.docker.webui: "https://${komodo_name}.${mydomain}/"
traefik.enable: true
traefik.docker.network: eth1
traefik.http.routers.komodo.entrypoints: https443
traefik.http.routers.komodo.service: komodo
traefik.http.routers.komodo.rule: "Host(`${komodo_name}.${mydomain}`)"
traefik.http.routers.komodo.tls: true
traefik.http.routers.komodo.middlewares: local-ipwhitelist@file, rate-limit@file
traefik.http.services.komodo.loadbalancer.server.port: 9120
homepage.group: Administration
homepage.name: ${komodo_name}
homepage.icon: komodo.png # https://github.com/walkxcode/dashboard-icons/tree/main/png https://gethomepage.dev/configs/services/#icons
homepage.href: https://${komodo_name}.${mydomain}
homepage.description: Docker management
homepage.weight: 1
# MongoDB #####################################################
mongodb:
container_name: ${mongodb_name}
image: mongo
<<: *config
command: --quiet --wiredTigerCacheSizeGB 0.25
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
komodo-net:
# ports:
# - 27017:27017
volumes:
- ${dockerdir}/MongoDB/db:/data/db
- ${dockerdir}/MongoDB/configdb:/data/configdb
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD}
labels:
<<: *labels
net.unraid.docker.icon: "https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png"
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
# Periphery ###################################################
periphery:
container_name: ${periphery_name}
image: ghcr.io/mbecker20/periphery:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
<<: *config
env_file: .env
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
eth1:
ipv4_address: ${periphery_ip}
komodo-net:
volumes:
## Mount external docker socket
- /var/run/docker.sock:/var/run/docker.sock
## Allow Periphery to see processes outside of container
- /proc:/proc
## use self signed certs in docker volume,
## or mount your own signed certs.
# - ssl-certs:/etc/komodo/ssl
## manage repos in a docker volume,
## or change it to an accessible host directory.
- ${dockerdir}/git:/etc/komodo/repos
## manage stack files in a docker volume,
## or change it to an accessible host directory.
- ${dockerdir}/git/homeserver/docker-compose:/etc/komodo/stacks
## Optionally mount a path to store compose files
# - /path/to/compose:/host/compose
labels:
<<: *labels
net.unraid.docker.icon: "https://raw.githubusercontent.com/peripheryapp/periphery/refs/heads/master/assets/logo.png"
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
# Networks ####################################################
networks:
eth1:
name: eth1
external: true
komodo-net:
internal: true
Periphery logs
2025-01-12T11:55:20.693164Z INFO periphery: Komodo Periphery version: v1.16.12
2025-01-12T11:55:20.693223Z INFO periphery: PeripheryConfig { port: 8120, repo_dir: "/etc/komodo/repos", stack_dir: "/etc/komodo/stacks", stats_polling_rate: FiveSeconds, legacy_compose_cli: false, logging: LogConfig { level: Info, stdio: Standard, otlp_endpoint: "", opentelemetry_service_name: "Komodo" }, allowed_ips: [], passkeys: ["##############"], include_disk_mounts: ["/etc/hostname"], exclude_disk_mounts: [], secrets: {}, git_providers: [], docker_registries: [], ssl_enabled: true, ssl_key_file: "/etc/komodo/ssl/key.pem", ssl_cert_file: "/etc/komodo/ssl/cert.pem" }
2025-01-12T11:55:20.693810Z INFO periphery: 🔒 Periphery SSL Enabled
2025-01-12T11:55:20.698408Z INFO generate_self_signed_ssl_certs: periphery::ssl: Generating certs...
2025-01-12T11:55:21.269141Z INFO generate_self_signed_ssl_certs: periphery::ssl: ✅ SSL Certs generated
2025-01-12T11:55:21.269279Z INFO periphery: Komodo Periphery starting on https://0.0.0.0:8120/
2025-01-12T12:25:06.391564Z WARN periphery::router: request f738eb94-57ad-4793-8944-891b83bf7855 | type: ComposePull | error: Failed to validate run directory on host after stack write (canonicalize error): No such file or directory (os error 2)
2025-01-12T12:25:22.067805Z WARN periphery::router: request 7046109c-dcfc-4827-b2aa-fe4c7368a65e | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.069272Z WARN periphery::router: request 400db4be-820a-4526-bb77-7fcffb73d894 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.070694Z WARN periphery::router: request 2c7c45d6-728b-4849-b11f-62435adeaa2f | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.072110Z WARN periphery::router: request 918a4f10-a696-4d77-a7e0-63461f2d6b81 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.073663Z WARN periphery::router: request 8f6ef062-1541-4db8-9c88-c31465ff9298 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.075169Z WARN periphery::router: request 6fdd8806-47f6-41e9-8dad-ab0016737736 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.076594Z WARN periphery::router: request eef937fc-a798-4a4c-9cf7-9cf533492dc6 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.078323Z WARN periphery::router: request 32a02c10-29e5-4874-ad5a-0fe649337acc | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
Originally created by @lordraiden on GitHub (Jan 12, 2025).
I loadad
I have my git repo here
- ${dockerdir}/git:/etc/komodo/repos
and the files here
- ${dockerdir}/git/homeserver/docker-compose:/etc/komodo/stacks

This is the toml configuration and this file exist /git/homeserver/docker-compose/dockge/docker-compose.yml
[[stack]]
name = "dockge"
tags = ["stack"]
[stack.config]
server = "unraid"
destroy_before_deploy = true
files_on_host = true
file_paths = ["docker-compose.yml"]
The thing is yesterday it was working, I added the stacks and I could deploy and stop them several times, and today for some reason (I have change anything) it looks like it doesn't have access to the files anymore, none of my stacks works I get this error If I try to deploy them
```
ERROR: Failed to validate run directory on host after stack write (canonicalize error)
TRACE:
1: No such file or directory (os error 2)
```
This is my full docker compose
```
###############################################################
# Komodo - Docker Management
###############################################################
# Common settings #############################################
x-default: &config
restart: unless-stopped
cpuset: 10,22,11,23
security_opt:
- no-new-privileges:true
dns:
- ${dns50}
x-labels: &labels
com.centurylinklabs.watchtower.enable: "true"
net.unraid.docker.managed: "composeman"
net.unraid.docker.shell: "sh"
# Services ####################################################
services:
# Komodo ######################################################
komodo:
container_name: ${komodo_name}
image: ghcr.io/mbecker20/komodo:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
<<: *config
env_file: .env
depends_on:
- mongodb
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
eth1:
ipv4_address: ${komodo_ip}
komodo-net:
ports:
- 9120:9120
volumes:
## Core cache for repos for latest commit hash / contents
- ${dockerdir}/Komodo/repo-cache:/repo-cache
## Store sync files on server
- ${dockerdir}/Komodo/syncs:/syncs
## Optionally mount a custom core.config.toml
# - /path/to/core.config.toml:/config/config.toml
## Allows for systemd Periphery connection at
## "http://host.docker.internal:8120"
# extra_hosts:
# - host.docker.internal:host-gateway
## Deploy Periphery container using this block,
## or deploy the Periphery binary with systemd using
## https://github.com/mbecker20/komodo/tree/main/scripts
environment:
KOMODO_DATABASE_ADDRESS: mongodb:27017
KOMODO_DATABASE_USERNAME: ${DB_USERNAME}
KOMODO_DATABASE_PASSWORD: ${DB_PASSWORD}
labels:
<<: *labels
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
net.unraid.docker.icon: "https://komo.do/img/logo512.png"
net.unraid.docker.webui: "https://${komodo_name}.${mydomain}/"
traefik.enable: true
traefik.docker.network: eth1
traefik.http.routers.komodo.entrypoints: https443
traefik.http.routers.komodo.service: komodo
traefik.http.routers.komodo.rule: "Host(`${komodo_name}.${mydomain}`)"
traefik.http.routers.komodo.tls: true
traefik.http.routers.komodo.middlewares: local-ipwhitelist@file, rate-limit@file
traefik.http.services.komodo.loadbalancer.server.port: 9120
homepage.group: Administration
homepage.name: ${komodo_name}
homepage.icon: komodo.png # https://github.com/walkxcode/dashboard-icons/tree/main/png https://gethomepage.dev/configs/services/#icons
homepage.href: https://${komodo_name}.${mydomain}
homepage.description: Docker management
homepage.weight: 1
# MongoDB #####################################################
mongodb:
container_name: ${mongodb_name}
image: mongo
<<: *config
command: --quiet --wiredTigerCacheSizeGB 0.25
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
komodo-net:
# ports:
# - 27017:27017
volumes:
- ${dockerdir}/MongoDB/db:/data/db
- ${dockerdir}/MongoDB/configdb:/data/configdb
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD}
labels:
<<: *labels
net.unraid.docker.icon: "https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png"
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
# Periphery ###################################################
periphery:
container_name: ${periphery_name}
image: ghcr.io/mbecker20/periphery:${COMPOSE_KOMODO_IMAGE_TAG:-latest}
<<: *config
env_file: .env
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local}
networks:
eth1:
ipv4_address: ${periphery_ip}
komodo-net:
volumes:
## Mount external docker socket
- /var/run/docker.sock:/var/run/docker.sock
## Allow Periphery to see processes outside of container
- /proc:/proc
## use self signed certs in docker volume,
## or mount your own signed certs.
# - ssl-certs:/etc/komodo/ssl
## manage repos in a docker volume,
## or change it to an accessible host directory.
- ${dockerdir}/git:/etc/komodo/repos
## manage stack files in a docker volume,
## or change it to an accessible host directory.
- ${dockerdir}/git/homeserver/docker-compose:/etc/komodo/stacks
## Optionally mount a path to store compose files
# - /path/to/compose:/host/compose
labels:
<<: *labels
net.unraid.docker.icon: "https://raw.githubusercontent.com/peripheryapp/periphery/refs/heads/master/assets/logo.png"
komodo.skip: # Prevent Komodo from stopping with StopAllContainers
# Networks ####################################################
networks:
eth1:
name: eth1
external: true
komodo-net:
internal: true
```
Periphery logs
```
2025-01-12T11:55:20.693164Z INFO periphery: Komodo Periphery version: v1.16.12
2025-01-12T11:55:20.693223Z INFO periphery: PeripheryConfig { port: 8120, repo_dir: "/etc/komodo/repos", stack_dir: "/etc/komodo/stacks", stats_polling_rate: FiveSeconds, legacy_compose_cli: false, logging: LogConfig { level: Info, stdio: Standard, otlp_endpoint: "", opentelemetry_service_name: "Komodo" }, allowed_ips: [], passkeys: ["##############"], include_disk_mounts: ["/etc/hostname"], exclude_disk_mounts: [], secrets: {}, git_providers: [], docker_registries: [], ssl_enabled: true, ssl_key_file: "/etc/komodo/ssl/key.pem", ssl_cert_file: "/etc/komodo/ssl/cert.pem" }
2025-01-12T11:55:20.693810Z INFO periphery: 🔒 Periphery SSL Enabled
2025-01-12T11:55:20.698408Z INFO generate_self_signed_ssl_certs: periphery::ssl: Generating certs...
2025-01-12T11:55:21.269141Z INFO generate_self_signed_ssl_certs: periphery::ssl: ✅ SSL Certs generated
2025-01-12T11:55:21.269279Z INFO periphery: Komodo Periphery starting on https://0.0.0.0:8120/
2025-01-12T12:25:06.391564Z WARN periphery::router: request f738eb94-57ad-4793-8944-891b83bf7855 | type: ComposePull | error: Failed to validate run directory on host after stack write (canonicalize error): No such file or directory (os error 2)
2025-01-12T12:25:22.067805Z WARN periphery::router: request 7046109c-dcfc-4827-b2aa-fe4c7368a65e | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.069272Z WARN periphery::router: request 400db4be-820a-4526-bb77-7fcffb73d894 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.070694Z WARN periphery::router: request 2c7c45d6-728b-4849-b11f-62435adeaa2f | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.072110Z WARN periphery::router: request 918a4f10-a696-4d77-a7e0-63461f2d6b81 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.073663Z WARN periphery::router: request 8f6ef062-1541-4db8-9c88-c31465ff9298 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.075169Z WARN periphery::router: request 6fdd8806-47f6-41e9-8dad-ab0016737736 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.076594Z WARN periphery::router: request eef937fc-a798-4a4c-9cf7-9cf533492dc6 | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
2025-01-12T12:25:22.078323Z WARN periphery::router: request 32a02c10-29e5-4874-ad5a-0fe649337acc | type: GetComposeContentsOnHost | error: Failed to initialize run directory: No such file or directory (os error 2)
```
I have been able to reproduce the issue, it happens after doing a clone repo using Komodo, apparently after restarting the komodo stack it works, for now
@lordraiden commented on GitHub (Jan 12, 2025):
I have been able to reproduce the issue, it happens after doing a clone repo using Komodo, apparently after restarting the komodo stack it works, for now
I see the issue happening. When you do "Clone Repo" for an already cloned repo, it will treat that command as "Re-clone", ie delete existing folder and clone it again. However that .../git/homeserver/docker-compose is being mounted to Periphery container, and when you delete it, this breaks the mount even after the folder is recreated. This is why it works again after you recreate Periphery container, this fixes the mount.
The fix for this would be to change those commands to "Pull Repo" instead, which won't delete folder and just pull the changes. This way the docker mount is never "broken".
Also you should check out #180, there's improvements to the docker mounts for Periphery in there. Basically with your current configuration, relative mounts will be broken. I have updated the example compose files in the next release branch: https://github.com/mbecker20/komodo/blob/1.17.0/compose/mongo.compose.yaml#L63. The change is to ensure the path inside and outside container is 1:1.
@mbecker20 commented on GitHub (Jan 12, 2025):
I see the issue happening. When you do "Clone Repo" for an already cloned repo, it will treat that command as "Re-clone", ie delete existing folder and clone it again. However that `.../git/homeserver/docker-compose` is being mounted to Periphery container, and when you delete it, this breaks the mount even after the folder is recreated. This is why it works again after you recreate Periphery container, this fixes the mount.
The fix for this would be to change those commands to "Pull Repo" instead, which won't delete folder and just pull the changes. This way the docker mount is never "broken".
Also you should check out #180, there's improvements to the docker mounts for Periphery in there. Basically with your current configuration, relative mounts will be broken. I have updated the example compose files in the next release branch: https://github.com/mbecker20/komodo/blob/1.17.0/compose/mongo.compose.yaml#L63. The change is to ensure the path inside and outside container is 1:1.
@mbecker20 Thanks for the answer, honestly I don't fully understand how can I adapt the new compose to work with the next release.
My requirements are simple I have my repo in github and I have it in sync in local.
I need the files locally because I won't always manage the stacks using Komodo.
I tried to create a stack using github directly but it clones the entire repo for each stack so isn't a very elegant solution.
So I finally decided to keep the local git synced and configure the stack to pick the files from a local path.
Ideally I would want the stacks files to be picked directly from the git local repo to have a single source of truth and not having files everywhere. So considering this and the paths
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So considering this how should I configure the new compose file? and what Run Directory path should I use in the stacks?
I there a better workflow/approach that I'm not considering?
@lordraiden commented on GitHub (Jan 13, 2025):
@mbecker20 Thanks for the answer, honestly I don't fully understand how can I adapt the new compose to work with the next release.
My requirements are simple I have my repo in github and I have it in sync in local.
I need the files locally because I won't always manage the stacks using Komodo.
I tried to create a stack using github directly but it clones the entire repo for each stack so isn't a very elegant solution.
So I finally decided to keep the local git synced and configure the stack to pick the files from a local path.
Ideally I would want the stacks files to be picked directly from the git local repo to have a single source of truth and not having files everywhere. So considering this and the paths
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So considering this how should I configure the new compose file? and what Run Directory path should I use in the stacks?
I there a better workflow/approach that I'm not considering?
I would move the stacks directory to be separate from the repo directory. But you may use neither of them. To be totally sure about the paths you are dealing with, you can specify the absolute "Path" (including leading /) that the Repo is cloned to. And for each Stack, you can use also use absolute path (including leading /) pointing to the Run Directory. I also recommend reading #220 and #180 to understand how things work a bit more.
maybe something like this:
periphery:...volumes:...# Need a 1:1 mount to fix relative mounts on deployed stacks/mnt/services/docker/git:/mnt/services/docker/git
[[repo]]name="komodo-periphery"[repo.config]server="server-01"repo="mbecker20/komodo"# https://docs.rs/komodo_client/latest/komodo_client/entities/repo/struct.RepoConfig.html#structfield.pathpath="/mnt/services/docker/git/homeserver"# use absolute clone path[[stack]]name="test"[stack.config]server="server-01"files_on_host=truerun_directory="/mnt/services/docker/git/homeserver/test"# use absolute run directoryfile_paths=["docker-compose.yml"]
"Clone Repo" deletes existing folder before cloning again and may cause data loss if using relative mounts. This is the direct cause of your original issue.
@mbecker20 commented on GitHub (Jan 13, 2025):
I would move the stacks directory to be separate from the repo directory. But you may use neither of them. To be totally sure about the paths you are dealing with, you can specify the absolute "Path" (including leading `/`) that the Repo is cloned to. And for each Stack, you can use also use absolute path (including leading `/`) pointing to the Run Directory. I also recommend reading #220 and #180 to understand how things work a bit more.
maybe something like this:
```yaml
periphery:
...
volumes:
...
# Need a 1:1 mount to fix relative mounts on deployed stacks
/mnt/services/docker/git:/mnt/services/docker/git
```
```toml
[[repo]]
name = "komodo-periphery"
[repo.config]
server = "server-01"
repo = "mbecker20/komodo"
# https://docs.rs/komodo_client/latest/komodo_client/entities/repo/struct.RepoConfig.html#structfield.path
path = "/mnt/services/docker/git/homeserver" # use absolute clone path
[[stack]]
name = "test"
[stack.config]
server= "server-01"
files_on_host = true
run_directory = "/mnt/services/docker/git/homeserver/test" # use absolute run directory
file_paths = ["docker-compose.yml"]
```
I also recommend to use "Pull Repo" instead of using "Clone Repo". https://docs.rs/komodo_client/latest/komodo_client/api/execute/struct.PullRepo.html
"Clone Repo" deletes existing folder before cloning again and may cause data loss if using relative mounts. This is the direct cause of your original issue.
Sorry but even a know a little bit about docker with linux I'm mostly lost,
Particulary for me this part is confusing having this in the compose file
${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos
and then in the env file this:
PERIPHERY_ROOT_DIRECTORY=/etc/komodo
Anyway for now I would be happy making it work, I will try to understand why later xD
These are my absolutes paths, I'm using Unraid so the files are mounted in shares.
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So basicaly the new compose would be
Docker compose
periphery:
...
environment:
PERIPHERY_REPO_DIR: "/mnt/services/docker/git/"
PERIPHERY_STACK_DIR: "/mnt/services/docker/git/homeserver/docker-compose"
...
volumes:
...
# Need a 1:1 mount to fix relative mounts on deployed stacks
/mnt/services/docker/git:/mnt/services/docker/git
env file
## Specify the root directory used by Periphery agent.
PERIPHERY_ROOT_DIRECTORY=/mnt/services/docker/git/
Repo toml, is a github repo, that will clone the repo inside /mnt/services/docker/git/ adding homeserver/docker-compose/monitoring/...
[[stack]]
name = "monitoring"
[stack.config]
server= "server-01"
files_on_host = true
run_directory = "/mnt/services/docker/git/homeserver/docker-compose/monitoring" # the docker-compose and env files are inside monitoring
file_paths = ["docker-compose.yml"]
Am I right?
@lordraiden commented on GitHub (Jan 13, 2025):
Sorry but even a know a little bit about docker with linux I'm mostly lost,
Particulary for me this part is confusing having this in the compose file
${_PERIPHERY_ROOT_DIRECTORY:-/etc/komodo_}/repos
and then in the env file this:
PERIPHERY_ROOT_DIRECTORY=/etc/komodo
Anyway for now I would be happy making it work, I will try to understand why later xD
These are my absolutes paths, I'm using Unraid so the files are mounted in shares.
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So basicaly the new compose would be
Docker compose
```
periphery:
...
environment:
PERIPHERY_REPO_DIR: "/mnt/services/docker/git/"
PERIPHERY_STACK_DIR: "/mnt/services/docker/git/homeserver/docker-compose"
...
volumes:
...
# Need a 1:1 mount to fix relative mounts on deployed stacks
/mnt/services/docker/git:/mnt/services/docker/git
```
env file
```
## Specify the root directory used by Periphery agent.
PERIPHERY_ROOT_DIRECTORY=/mnt/services/docker/git/
```
Repo toml, is a github repo, that will clone the repo inside /mnt/services/docker/git/ adding homeserver/docker-compose/monitoring/...
```
[[repo]]
name = "homeserver"
[repo.config]
server = "unraid"
builder = "local"
git_account = "username"
repo = "username/homeserver"
links = [
"https://github.com/username/homeserver"
]
```
Stack toml
```
[[stack]]
name = "monitoring"
[stack.config]
server= "server-01"
files_on_host = true
run_directory = "/mnt/services/docker/git/homeserver/docker-compose/monitoring" # the docker-compose and env files are inside monitoring
file_paths = ["docker-compose.yml"]
```
Am I right?
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @lordraiden on GitHub (Jan 12, 2025).
I loadad
I have my git repo here
and the files here
This is the toml configuration and this file exist /git/homeserver/docker-compose/dockge/docker-compose.yml
stack
name = "dockge"
tags = ["stack"]
[stack.config]
server = "unraid"
destroy_before_deploy = true
files_on_host = true
file_paths = ["docker-compose.yml"]
The thing is yesterday it was working, I added the stacks and I could deploy and stop them several times, and today for some reason (I have change anything) it looks like it doesn't have access to the files anymore, none of my stacks works I get this error If I try to deploy them
This is my full docker compose
Periphery logs
@lordraiden commented on GitHub (Jan 12, 2025):
I have been able to reproduce the issue, it happens after doing a clone repo using Komodo, apparently after restarting the komodo stack it works, for now
@mbecker20 commented on GitHub (Jan 12, 2025):
I see the issue happening. When you do "Clone Repo" for an already cloned repo, it will treat that command as "Re-clone", ie delete existing folder and clone it again. However that
.../git/homeserver/docker-composeis being mounted to Periphery container, and when you delete it, this breaks the mount even after the folder is recreated. This is why it works again after you recreate Periphery container, this fixes the mount.The fix for this would be to change those commands to "Pull Repo" instead, which won't delete folder and just pull the changes. This way the docker mount is never "broken".
Also you should check out #180, there's improvements to the docker mounts for Periphery in there. Basically with your current configuration, relative mounts will be broken. I have updated the example compose files in the next release branch: https://github.com/mbecker20/komodo/blob/1.17.0/compose/mongo.compose.yaml#L63. The change is to ensure the path inside and outside container is 1:1.
@lordraiden commented on GitHub (Jan 13, 2025):
@mbecker20 Thanks for the answer, honestly I don't fully understand how can I adapt the new compose to work with the next release.
My requirements are simple I have my repo in github and I have it in sync in local.
I need the files locally because I won't always manage the stacks using Komodo.
I tried to create a stack using github directly but it clones the entire repo for each stack so isn't a very elegant solution.
So I finally decided to keep the local git synced and configure the stack to pick the files from a local path.
Ideally I would want the stacks files to be picked directly from the git local repo to have a single source of truth and not having files everywhere. So considering this and the paths
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So considering this how should I configure the new compose file? and what Run Directory path should I use in the stacks?
I there a better workflow/approach that I'm not considering?
@mbecker20 commented on GitHub (Jan 13, 2025):
I would move the stacks directory to be separate from the repo directory. But you may use neither of them. To be totally sure about the paths you are dealing with, you can specify the absolute "Path" (including leading
/) that the Repo is cloned to. And for each Stack, you can use also use absolute path (including leading/) pointing to the Run Directory. I also recommend reading #220 and #180 to understand how things work a bit more.maybe something like this:
I also recommend to use "Pull Repo" instead of using "Clone Repo". https://docs.rs/komodo_client/latest/komodo_client/api/execute/struct.PullRepo.html
"Clone Repo" deletes existing folder before cloning again and may cause data loss if using relative mounts. This is the direct cause of your original issue.
@lordraiden commented on GitHub (Jan 13, 2025):
Sorry but even a know a little bit about docker with linux I'm mostly lost,
Particulary for me this part is confusing having this in the compose file
${PERIPHERY_ROOT_DIRECTORY:-/etc/komodo}/repos
and then in the env file this:
PERIPHERY_ROOT_DIRECTORY=/etc/komodo
Anyway for now I would be happy making it work, I will try to understand why later xD
These are my absolutes paths, I'm using Unraid so the files are mounted in shares.
my git repo
/mnt/services/docker/git
Stack files here
/mnt/services/docker/git/homeserver/docker-compose
So basicaly the new compose would be
Docker compose
env file
Repo toml, is a github repo, that will clone the repo inside /mnt/services/docker/git/ adding homeserver/docker-compose/monitoring/...
Stack toml
Am I right?
@mbecker20 commented on GitHub (Jan 15, 2025):
Yeah I think it should work, you can try it out