-
Notifications
You must be signed in to change notification settings - Fork 77
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
Using caddy as entrypoint #72
Comments
@ebati you are correct. Is this a request to do that, or is there a use-case that you need to enable with this? Setting I did have an entrypoint script at some point (in #8, though some of the history is lost), but there were some difficulties in getting it to work with all cases. We discussed the specifics and for now it seemed a fair tradeoff to just accept the repetition of the word That being said, I wouldn't be opposed to accepting a PR that includes a well-written entrypoint script that:
|
I'm not super inclined to change the command package to accommodate a niche use case at this point, but if there's a compelling reason to, we can definitely consider it as long as it's backwards-compatible.
|
I think it would be reasonably simple to have a |
Probably newline-delimited. Does it need the command descriptions too? |
IMO no, we only need to know the words that need to be allowed to pass through to the |
So @francislavoie and I are chatting about this in Slack and it may be possible to accomplish this in a way similar to how Basically it depends on In Caddy's case, we get a Note that it does involve slightly more execution time though. 🤷♂️ |
I must be missing some point but ... Can't we just give By the way, I don't want to waste your time, if this requires a complex script, we can just close this issue as this is not something important. 😄 |
Having to override the entrypoint like that isn't as nice I'd say. |
You are right, use case with override is not nice. But I think most people will use this image without changing entrypoint, as this is a single purpose image. |
This absolutely isn't a waste of time! While it might seem like it's not very important, you're not the only one to want this, so it is IMO worth exploring.
It's important that we support a better user experience with this image, since it's an official Docker image. It needs to behave similarly to other official images, which quite often have entrypoint scripts. And regardless of those reasons, the current image behaves a certain way, and I think it's most crucial that we not break current users. |
Official reference: https://github.com/docker-library/official-images#consistency |
Thanks for the link @serverwentdown |
So if I read that correctly, this supports the argument that |
@rugk I would say that by Docker recommendations, the And since no initialisation is necessary before running So I'd think better to keep it simple with no ✨magic✨ entrypoint involved. But, traefik's entrypoint is a neat solution! |
Oh yeah, you're right, then it is indeed "If the startup process does not need arguments" (point 1) and the thing is fine as it is… I wodner what exactly the use case of the OP was here. Even with Ah also looking at |
@rugk At the moment, unlike traefik and some other images, to run caddy requires including |
This issue feels related to something I'm running into. I'm having trouble passing --envfile to caddy using this docker image. It seems no matter what I do, specifying a command: in a docker compose file leads to an error. Is this supposed to be possible?
|
@isujtauke you need to specify the full path to the binary, i.e. |
For what it's worth, one can go beyond just an entrypoint. I was playing with a multistage Dockerfile and on the last stage I tried this
Which ended up in a nice small 40MB image. You just have to attach all the directories in your dockerfile So far I have no issues with it on my caddy/php-fpm/mariadb stack. Perhaps this is nice for an extra tag/image for those that want an absolutely minimal option. There is no bash, and commands seem to work ok but are not executed in the context of the running container. caddy stop does close the process through
|
@dimkasta you're missing mailcap (for |
For debugging all you have to do is change the target of your compose to the full image or dev on the multistage Dockerfile. You can even target an image with go and xcaddy installed. For ca-certificates and mailcap, thanks for letting me know. I am not familiar with the code base and thought the binary had all it needed statically compiled. |
The program has no dynamically linked libraries, but it does load additional system-shipped files that are best maintained externally (CA cert bundles are kinda large for example). |
You can use caddy command as
ENTRYPOINT
and give default options inCMD
that would simplify running with other options and also remove duplicate caddy (one for image name one for executable name) in examples.The text was updated successfully, but these errors were encountered: