How to use pluggins with docker?

(Narnikgamarnik) #1


I already wrote about my problem that my LetsEncrypt limit is used, and I’m now trying to use TLS Cloudflare.

This is my Caddyfile:

www.{$DOMAIN_NAME} {

    proxy / myapp:5000 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-Proto {scheme}
    tls {
    	dns cloudflare
    log stdout
    errors stdout

But, if I run docker-compose -f production.yml up --build, got error:

caddy_1 | 2018/01/15 13:59:07 /etc/Caddyfile:12 - Parse error: Unsupported DNS provider ‘cloudflare’

In the Dockerfile I added:

ARG plugins="git, cloudflare"

And now it looks like this:

FROM abiosoft/caddy:0.10.6
ARG plugins="git, cloudflare"
COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile

But I keep getting the same mistake.
What am I doing wrong?

(Matthew Fay) #2

Based on the example from the Docker Hub page, I’m guessing the space in the middle of the variable is the problem. Try just comma-delimited, rather than comma-space-delimited.


docker build --build-arg \
    plugins=filemanager,git,linode \

(Narnikgamarnik) #3

I saw your example, but I do not understand how to use it in my case.
I’m using docker-compose, and I’m not writing the docker build command.

I gave an example of Dockerfile

And here is part of my production.yml file:

      context: .
      dockerfile: ./compose/production/caddy/Dockerfile
      - myapp
      - caddy:/root/.caddy
    env_file: .env
      - ""
      - ""

(Matthew Fay) #4

The example I provided wasn’t for use, it was for comparison. Specifically, note the format of the arg from the example I linked to:


Now compare with the example you provided:

git, cloudflare

Which led to the suggestion that perhaps you should try without a space:

(Narnikgamarnik) #5

No changes occurred, and still I get the error “Parse error: Unsupported DNS provider 'cloudflare'”, regardless of whether a space is used after the comma.

(Matthew Fay) #6

Hmm. Did you do another docker build after making changes?

(Abiola Ibrahim) #7

If you want to select plugins in your Dockerfile, you need to use abiosoft/caddy:builder in a multi-stage build. Pulling from abiosoft/caddy does not recompile Caddy.

The other option you have is to specify the git repo as the build context like it is done here.

(system) #8

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.