sablierapp / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://sablierapp.dev/
GNU Affero General Public License v3.0
1.46k stars 48 forks source link

BUILD fails #434

Closed alx-xlx closed 2 weeks ago

alx-xlx commented 2 weeks ago

Describe the bug I am trying to build the Dockerfile with cloudflare-dns and sablier plugins. And it fails saying I need caddy version 2.6.5 But the latest version is 2.6.4. Here is my Dockerfile

ARG CADDY_VERSION=2.6.4

# Step 1: Build stage with both Cloudflare DNS and Sablier plugins
FROM caddy:${CADDY_VERSION}-builder AS builder

# Add Sablier source code
ADD https://github.com/sablierapp/sablier.git#v1.8.1 /sablier

# Run xcaddy build with both plugins
RUN xcaddy build \
    --with github.com/caddy-dns/cloudflare \
    --with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy

# Step 2: Copy the built Caddy binary to the final image
FROM caddy:${CADDY_VERSION}

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Context ERROR MESSAGE:

59.00 go: added google.golang.org/protobuf v1.28.1
59.01 2024/11/04 01:29:09 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2@v2.6.4
61.48 go: downloading github.com/caddy-dns/cloudflare v0.0.0-20240703190432-89f16b99c18e
65.47 go: github.com/caddy-dns/cloudflare@upgrade (v0.0.0-20240703190432-89f16b99c18e) requires github.com/caddyserver/caddy/v2@v2.7.5, not github.com/caddyserver/caddy/v2@v2.6.4
65.48 2024/11/04 01:29:16 [FATAL] exit status 1
------
Dockerfile:8
--------------------
   7 |     # Build Caddy with both the Cloudflare DNS plugin and the Sablier plugin
   8 | >>> RUN xcaddy build \
   9 | >>>     --with github.com/caddy-dns/cloudflare \
  10 | >>>     --with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy
  11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c xcaddy build     --with github.com/caddy-dns/cloudflare     --with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy" did not complete successfully: exit code: 1

Expected behavior A clear and concise description of what you expected to happen.

Additional context I am using the following command to build. docker build -t caddy-cloudflare-sablier:latest .

acouvreur commented 2 weeks ago

Hello @alx-xlx

caddy dns requires caddy version 2.7.5 at least

https://github.com/caddy-dns/cloudflare/blob/89f16b99c18ef49c8bb470a82f895bce01cbaece/go.mod#L6

while sablier requires version 2.8.4 at least

https://github.com/sablierapp/sablier/blob/a958703db7a2eea7eae915fe65695dd9c3f2f355/plugins/caddy/go.mod#L5

Please change

ARG CADDY_VERSION=2.6.4

To

ARG CADDY_VERSION=2.8.4