3 ms·
Hm, i found this to be pretty straight forward through Docker: e.g: FROM caddy:2-builder AS builder RUN xcaddy build \ --with github.com/green
by hantusk 4y ago
Hm, i found this to be pretty straight forward through Docker:
e.g:
FROM caddy:2-builder AS builder
RUN xcaddy build \
--with github.com/greenpau/caddy-security
FROM caddy:2
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
You can keep your container image, and just do the "COPY --from=builder" step in there. We do this in CI/CD on every build.
- vbezhenar 4y agoI did something similar. It puts my server to knees and takes something like a hour to complete, requiring all services to stop before I can run it. This is extremely unergonomic for me.
- jamespo 4y agowhat's the server spec?
- vbezhenar 4y agoVPS with 1 core and 512 MB RAM. I just checked, not really a hour, it spent 25 minutes and then failed with "no space left on device". Right now there's 4.9GB free, so it takes at least around 5 GB disk space which is an issue as well. Building on separate computer will work, of course, but it makes everything more complex.
- zebracanevra 4y agoEasy way around that is to use a CI service like GH Actions. Build it there, push it to dockerhub, and you're done. Have it run on a schedule to keep it updated, if necessary. Alternatively, GH Actions allows you to set a manual trigger so you can rebuild whenever.
- rootsu 4y agoYou can just create the image on some other powerful server and the just pull the final image from the registry.