coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.89k stars 1.91k forks source link

[Bug]: Docker-compose volume file source mounting as directory #3375

Open nickhid opened 2 months ago

nickhid commented 2 months ago

Description

When attempting to mount a file with docker-compose, Coolify mounts as a directory instead.

Minimal Reproduction (if possible, example repository)

Example docker-compose.yml

services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    volumes:
      - prometheus_data:/prometheus
      - type: bind
        source: ./config/prometheus.yml
        target: /etc/prometheus/prometheus.yml
        is_directory: false

Issue occurs when following Coolify documentation, including with is_directory:false, and with the less verbose ` volumes:

Workaround:

Project -> Configuration -> Storages -> Find Directory Mount & Convert to File -> Copy and paste file -> Save & redeploy

Exception or Error

Result:

image

Error:

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 "/data/coolify/applications/jw8088gk80s0o44c8ogsoc4w/config/prometheus.yml" to rootfs at "/etc/prometheus/prometheus.yml": mount /data/coolify/applications/jw8088gk80s0o44c8ogsoc4w/config/prometheus.yml:/etc/prometheus/prometheus.yml (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

Version

v4.0.0-beta.331

Cloud?

kmbuthia commented 2 months ago

Possible duplicate of https://github.com/coollabsio/coolify/issues/3303

allanvobraun commented 3 weeks ago

I have the same problem