xcaddy build has no way to cache dependency files
question
I hope I can execute `xcaddy build --download-dependency --with ...` and then execute `xcaddy build --with ...` separately, so that the Dockerfile can cache the dependency layer.
Dockerfile:
```
FROM caddy:builder AS builder
COPY ./caddy-plugin /app/caddy-plugin
RUN xcaddy build --download-dependency --with example.com/custom-plugin=/app/caddy-plugin/custom-plugin
RUN xcaddy build --with example.com/custom-plugin=/app/caddy-plugin/custom-plugin
FROM caddy
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
```
关闭于 2025-08-15 4 条评论