abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
768 stars 315 forks source link

using "docker run" ... unknown dns provider #183

Closed hiqbn closed 5 years ago

hiqbn commented 5 years ago

docker run -it -e CLOUDFLARE_EMAIL=something@example.com -e CLOUDFLARE_API_KEY=123456789 --name caddy -h caddy -p 2015:2015 -p 443:443 -v $(pwd)/Caddyfile:/etc/Caddyfile abiosoft/caddy

I need to run it as docker run instead of the docker compose method. can you pls help?

because i'm stuck at

       /etc/Caddyfile:6 - Error during parsing: Unknown DNS provider by name 'cloudflare'

nice software by the way and thanks in advance.

is this correct for example.com and wildcard subdomain for example.com?

Caddyfile


example.com *.example.com {
    proxy / http://10.1.0.123:80
    tls myemail@example.com

    tls {
        dns cloudflare
    }
}
abiosoft commented 5 years ago

cloudflare is not bundled with the default image.

Build your custom docker image and use it instead. You can include other plugins.

docker build -t mycaddy --build-arg \
    plugins=git,cloudflare \
    github.com/abiosoft/caddy-docker.git

Then run it

docker run -it -e CLOUDFLARE_EMAIL=something@example.com -e CLOUDFLARE_API_KEY=123456789 --name caddy -h caddy -p 2015:2015 -p 443:443 -v $(pwd)/Caddyfile:/etc/Caddyfile mycaddy

Feel free to re-open if this doesn't fix it for you.