Docker with buid & module with watchtower

1. The problem I’m having:

Not a true problem but a question

If I build caddy (on alpine ?) and use crowdsec module
Will watchtower be able to update caddy ?

In the “simple” caddy docker version there is no xcaddy ?

2. Error messages and/or full log output:

NA

3. Caddy version:

latest

4. How I installed and ran Caddy:

want to build it with docker run

a. System environment:

photon OS 5.X

b. Command:

NA

d. My complete Caddy config:

NA

5. Links to relevant resources:

NA

This is more of a Watchtower/Docker question than a Caddy one. The answer is that it depends on how you deploy your custom image.

With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.

https://hub.docker.com/r/v2tec/watchtower

If you build a new Caddy image and push it to a container registry, Watchtower can pull that and update the local container.

If you don’t push your custom Caddy builds to a registry - i.e. if you’re just building locally when you need to - I don’t believe Watchtower can help you.

1 Like

In a way right lol
thanks

Is there a way on the docker caddy (classic) to install xcaddy through command line ?
When xcaddy is installed I can install inside the docker whatever module I choose right ?
Thank you again for help

Yep. Use the builder tag. More details here:

1 Like

In this case, caddy builder will be updated by watchtower ?
Caddy builder is a flavor of caddy so periodically updated ?
Thanks

Well, yes, but…

Only if you run it directly from the image, without a Dockerfile. Which seems a little unproductive.

1 Like

Inside the docker image in sh
Is there a way to install inside container xcaddy ?
Idea is to have the caddy container without builder etc. And run a post watchtower update command

Module are no that easy to install (interested in crowdsec)

I’m not sure I fully understand what your intention is, but I can point you to the installation instructions for xcaddy, here:

1 Like

I have the same issue as this folks

Very interesting btw

Inside the caddy container there is no go command nor xcaddy.
Is there a way to install anything inside the container without building a custom one ?

Very kind of you for all the help :slight_smile:

I wonder if you could just use caddy add-package as your post-upgrade script.

1 Like

this one could do the trick
(experimental so …snapshot powa)
Thanks

The add-package command downloads a build from Download Caddy, which has no uptime guarantees. Building from source with xcaddy is more reliable for any kind of automation.

2 Likes

Thank you
But xcaddy is not very easy to automate with watchtower

We don’t recommend updating Caddy unattended anyway. There’s no guarantee that there won’t be breaking changes, so you should always be present and perform the update yourself so you’re there to fix your config if something stops working, otherwise you could end up with your server being down while not being able to fix it until you’re back at your desk.

You can sign up for Caddy release notifications, go to https://github.com/caddyserver/caddy then click Watch in the top-right and choose Custom and check only Releases. Keep in mind the Caddy Docker images can lag behind the release on Github (sometimes a few hours, sometimes a couple days, depends on human factors).

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.