docker-library/docs

I mount `/etc/caddy/Caddyfile` wrong,`/etc/caddy/Caddyfile` is a text file and not a folder.

Astro-Lee opened this issue · 2 comments

docs/caddy/README.md

Lines 108 to 115 in d6062c6

To override the default [`Caddyfile`](https://github.com/caddyserver/dist/blob/master/config/Caddyfile), you can mount a new one at `/etc/caddy/Caddyfile`:
```console
$ docker run -d -p 80:80 \
-v $PWD/Caddyfile:/etc/caddy/Caddyfile \
-v caddy_data:/data \
caddy
```

KA6X$UC@CJ3`S1F)BTVN7

Did you create the $PWD/Caddyfile on your host first? The target, /etc/caddy/Caddyfile, already exists in the container as a file, so you need to create your local one first. If the source, $PWD/Caddyfile, doesn't exist, then Docker will just assume you meant a directory and create it; then it fails because it can't mount a directory onto a file.

In the future, these sorts of questions/requests would be more appropriately posted to a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.