diff --git a/Dockerfile b/Dockerfile index ebb3154..a15d169 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,26 @@ -FROM caddy:builder AS builder +ARG version=2.1.0-beta.1 -RUN caddy-builder \ - github.com/caddy-dns/cloudflare +FROM golang:1.14-alpine3.11 AS builder +ARG version -FROM caddy:2.0.0 +WORKDIR /src -COPY --from=builder /usr/bin/caddy /usr/bin/caddy +RUN apk add --no-cache \ + git \ + ca-certificates +RUN go get -u github.com/caddyserver/xcaddy/cmd/xcaddy + +ENV CADDY_VERSION="v${version}" +RUN xcaddy build --with github.com/caddy-dns/cloudflare --output /usr/bin/caddy + +RUN /usr/bin/caddy version + +FROM caddy:${version} LABEL maintainer "Fabian Stamm " -# RUN apk add --no-cache \ -# ca-certificates \ -# git \ -# mailcap \ -# openssh-client \ -# tzdata \ -# bash \ -# curl + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy #Validate install