Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to build with Cloudflare plugin #236

Open
njm2112 opened this issue Dec 26, 2019 · 5 comments
Open

Not possible to build with Cloudflare plugin #236

njm2112 opened this issue Dec 26, 2019 · 5 comments

Comments

@njm2112
Copy link

njm2112 commented Dec 26, 2019

Resolution of this issue seems incorrectly to be indicated in this closed issue: #195 (comment)

when running docker build -t caddy --build-arg plugins=git,cloudflare,jwt,login,filter,cors,realip,filemanager,cache,expires github.com/abiosoft/caddy-docker.git, the build process clearly shows:

Sending build context to Docker daemon  109.6kB
Step 1/24 : FROM abiosoft/caddy:builder as builder
builder: Pulling from abiosoft/caddy
Digest: sha256:305e08cea6537ff651262d8a9c9fa1676b4f71dee96fa84f91352b3789a9d5b9
Status: Downloaded newer image for abiosoft/caddy:builder
 ---> 01e4c36185ca
Step 2/24 : ARG version="1.0.3"
 ---> Using cache
 ---> 3da066a92b94
Step 3/24 : ARG plugins="git,cors,realip,expires,cache,cloudflare"
 ---> Using cache
 ---> a5301b5c145b

First issue is that build is ignoring the plugins passed to it; why?

The plugins that are installed using the image built above are as follows:

me@NAS:/volume1/docker/_wip/caddy$ sudo docker exec -it caddy /bin/sh
/srv # caddy --plugins
Server types:
  http

Caddyfile loaders:
  short
  flag
  default

Other plugins:
  http.basicauth
  http.bind
  http.browse
  http.errors
  http.expvar
  http.ext
  http.fastcgi
  http.gzip
  http.header
  http.index
  http.internal
  http.limits
  http.log
  http.markdown
  http.mime
  http.pprof
  http.proxy
  http.push
  http.redir
  http.request_id
  http.rewrite
  http.root
  http.status
  http.templates
  http.timeouts
  http.websocket
  on
  tls
  tls.cluster.file

Second issue: where is the cloudflare plugin??? even if not accepting the plugins list I passed through to build, the cloudflare plugin is in the list that should be installed per the output of build so what gives?

@xizeyoupan
Copy link

Same problem here.

@xizeyoupan
Copy link

My solution:
Download caddy here with plugins and then -v like this
20200205120413.

@gotson
Copy link

gotson commented Feb 28, 2020

My solution:
Download caddy here with plugins and then -v like this
20200205120413.

That actually works very well. This let me have the latest version of the tls.cloudflare plugin which supports CLOUDFLARE_DNS_API_TOKEN instead of email + key.

@phlinhng
Copy link

My solution is to build my own alpine-based docker containers .

FROM alpine:latest

ARG plugins=tls.dns.cloudflare

RUN apk add --no-cache curl libcap

RUN curl --silent --show-error --fail --location --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
      "https://caddyserver.com/download/linux/amd64?plugins=${plugins}&license=personal&telemetry=off" \
    | tar --no-same-owner -C /usr/bin/ -xz caddy \
 && chmod 0755 /usr/bin/caddy \
 && addgroup -S caddy \
 && adduser -D -S -s /sbin/nologin -G caddy caddy \
 && setcap cap_net_bind_service=+ep `readlink -f /usr/bin/caddy` \
 && /usr/bin/caddy -version

COPY Caddyfile /etc/Caddyfile

ENTRYPOINT ["/usr/bin/caddy"]
CMD ["--conf", "/etc/Caddyfile"]

Thanks yobasystems/alpine-caddy for the Dockerfile.

@MisterDuval
Copy link

Use this new image which is valid and up-to-date:
https://hub.docker.com/r/adriel/caddy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants