caddyserver / caddy-docker

Source for the official Caddy v2 Docker Image
https://hub.docker.com/_/caddy
Apache License 2.0
405 stars 74 forks source link

Broken docker file #302

Closed v3ss0n closed 1 year ago

v3ss0n commented 1 year ago
localcdn:
  image: caddy:2.7.0-beta.1-alpine
  restart: unless-stopped
  command: caddy file-server --browse
  ports:
    - 4443:443
  volumes:
    - $PWD/Caddyfile:/etc/caddy/Caddyfile
    - $PWD/site:/srv
    - caddy_data:/data
    - caddy_config:/config
volumes:
  cache-data: {}
  caddy_data: {}
  caddy_config: {}
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 "/home/nozander/Workspace/sprintlog/sprintlog-backend/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /home/nozander/Workspace/sprintlog/sprintlog-backend/Caddyfile:/etc/caddy/Caddyfile (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
v3ss0n commented 1 year ago
localcdn:
  image: caddy:latest
  restart: unless-stopped
  command: caddy file-server --browse
  ports:
    - 4443:443
  volumes:
    - $PWD/Caddyfile:/etc/caddy/Caddyfile
    - $PWD/site:/srv
    - caddy_data:/data
    - caddy_config:/config
volumes:
  cache-data: {}
  caddy_data: {}
  caddy_config: {}
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 "/home/nozander/Workspace/sprintlog/sprintlog-backend/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /home/nozander/Workspace/sprintlog/sprintlog-backend/Caddyfile:/etc/caddy/Caddyfile (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
francislavoie commented 1 year ago

You need to have a file called Caddyfile next to your docker-compose.yml. It's not a directory.

v3ss0n commented 1 year ago

thanks fixed.