D
Dokploy10mo ago
Exi

can't mount the file

I used example from https://discord.com/channels/1234073262418563112/1253358117513855049/1253383890064773191 but get error while deploy:
Initializing deployment
Creating File 'docker-compose.yml' to /etc/dokploy/compose/test-nginx-79c2af/code: ✅

File 'docker-compose.yml' created: ✅

╔══════════════════════════════════════════════════════════════════════════════╗

App Name: test-nginx-79c2af ║
Build Compose 🐳 ║
Detected: 2 mounts 📂 ║
Command: docker compose -p test-nginx-79c2af -f docker-compose.yml up -d
--build --remove-orphans
Source Type: docker raw ✅ ║
Compose Type: docker-compose ✅ ║

╚══════════════════════════════════════════════════════════════════════════════╝
Container test-nginx-79c2af-whoami-1 Running
Container test-nginx-79c2af-nginx-1 Starting
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/etc/dokploy/compose/test-nginx-79c2af/code/nginx.conf" to rootfs at "/etc/nginx/nginx.conf": mount /etc/dokploy/compose/test-nginx-79c2af/code/nginx.conf:/etc/nginx/nginx.conf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Error
Initializing deployment
Creating File 'docker-compose.yml' to /etc/dokploy/compose/test-nginx-79c2af/code: ✅

File 'docker-compose.yml' created: ✅

╔══════════════════════════════════════════════════════════════════════════════╗

App Name: test-nginx-79c2af ║
Build Compose 🐳 ║
Detected: 2 mounts 📂 ║
Command: docker compose -p test-nginx-79c2af -f docker-compose.yml up -d
--build --remove-orphans
Source Type: docker raw ✅ ║
Compose Type: docker-compose ✅ ║

╚══════════════════════════════════════════════════════════════════════════════╝
Container test-nginx-79c2af-whoami-1 Running
Container test-nginx-79c2af-nginx-1 Starting
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/etc/dokploy/compose/test-nginx-79c2af/code/nginx.conf" to rootfs at "/etc/nginx/nginx.conf": mount /etc/dokploy/compose/test-nginx-79c2af/code/nginx.conf:/etc/nginx/nginx.conf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Error
How i can mount file from "File mount"?
2 Replies
Exi
ExiOP10mo ago
I found the problem that the file is created in the files subdirectory, even if the path is explicitly specified ./ and as a result, you should use ../files/nginx.conf path in volumes
Siumauricio
Siumauricio10mo ago
You are correct!✅

Did you find this page helpful?