-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update local base images built from local Dockerfile #1824
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
I also need this feature and hope it can be implemented. Thank you |
Same here. This is my
and caddy uses the following to implement some plugins:
which is built when running docker-compose with I just run watchtower for the first time and realised it updated caddy without re-building it:
Which meant caddy became unusable for how I set it up. Is there a way around it? Or should we just set watchtower to exclude caddy for the time being? Thanks |
You could use https://github.com/crazy-max/diun to watch for changes and rebuild the local image whenever caddy is updated. Then you can just put a LABEL "com.centurylinklabs.watchtower.no-pull"="true" |
Thanks for the suggestion. This has been more complicated than I expected because I wanted to run Diun from docker, but I think I managed to get it working. For reference, I added the label as you suggest to the container to monitor. This is my diun container:
Note that I am running the container as user 990. Then, I created a named pipeline as described here.
I also created a
and the command that diun executes
Finally, I added the root executable to crontab with
I have tested the pipe, the executables and tested from the container and it seems to work. I will monitor the crontab and hope it will work next time there is an update. If anyone has suggestions on how to improve this flow, don't be shy. I have aimed not to |
Very clear AND complicated for prod. xcaddy is not included inside the docker image ? |
answering to myself This could be a post watchtower update script Inside docker compose
Inside the sh (for cloudflaer and exemple)
|
If I understand your suggestion, you aim to add caddy to the running container? That means that the changes won't be persistent, and cloudflare would only be added if updated and launched via watchtower. I think this is flimsy and prone to error? |
No the process I have something similar for a year with wordpress and a php module not with the official container. Works flawlessly. |
Sorry, I made a typo in my comment. I meant you add cloudflare to the caddy container. But you make changes when the container is running, so these changes would not be permanent (if I understand correctly how this works). So if you stop and start the container manually, wouldn't you loose the post-update changes? I believe the correct way is to rebuild the image, or am I misunderstanding something? |
If add package is permanent (and it is if I understand it correctly) the script post watchtower is "permanent" In the case of wordpress |
Just for the sake of completeness, your method modifies the container, writing to its writable layer. If you stop and restart the container it will work. If you delete the container or update it manually (without running the post-install script), then the new container will not include the module. With my method, which is much more involved, the module is added to the image at build time, and it will persist if you delete the container and recreate it again afterwards. |
Is your feature request related to a problem? Please describe.
I use caddy base image inside a Dockerfile and add plugins to it. My docker compose is similar to this:
with a local Dockerfile:
Describe the solution you'd like
I would like to track
caddy:latest
and rebuild my Dockerfile image when a new image is published.Describe alternatives you've considered
Maybe a pre-hook script on watchtower or a cron-job on building this docker image once per day or per week.
Additional context
No response
The text was updated successfully, but these errors were encountered: