-
Notifications
You must be signed in to change notification settings - Fork 855
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
Built-in Docker Healthcheck #1126
Comments
I second this. Would be very helpful when using auto heal. |
Using the following Dockerfile could be working:
Credits: |
I think that PR is helpful, although it may also be worth reevaluating whether the current However, I would find a more helpful base image to be There is a case to be made that a |
No one is going to use copy curl from a unreputable image like that. But the general method is right. It is better however, to use
FROM gcr.io/distroless/java21-debian12:nonroot
COPY --from=busybox:stable-glibc /bin/wget /usr/bin/wget If you wanted to save 500Kb-1Mb and add security the alternative is add healthcheck Go code to the repo. This could either be a separate static binary with a http call. Or add onto the CLI with a flag, I have 2 PRs I did recently with other dockerfiles that expand the app to have a healthcheck feature. So, those could be looked as general examples (but none of them are in go, they are in rust, and in node+python)
debian distroless is fine. No need to change off of it. Tons of Go projects work this way. |
A good rule of thumb with Docker images, is to put in what you need and no more. Distroless image is far more than is needed. Not a deal breaker or concern, but unnecessary if it's a pure go build.
Also a Or, as mentioned above, make the base image |
All of this is irrelevant, if the cloudflared binary could execute a command to check the #1135 We need this merged, to close this issue. |
I'm testing the curl method:
in AWS ECS like this:
But the healthcheck is not working in ECS. (it does locally... 🤷 ). So i'm really waiting for #1135 to get released and have a proper standard solution. |
This is badly needed. For me, the Cloudflared docker container locks up every few days for unknown reasons |
I ran into this and am surprised there's not a buitl-in way to do healthchecks. I wrote up my workaround where I ended up adding a separate service to my docker-compose.yml for health checks. |
Describe the feature you'd like
I would like the docker image to contain curl or wget so it's possible to create a docker healthcheck that docker-compose or docker swarm can use.
It would be nice the healthchecking is just native to the cloudflare/cloudflared image like so.
If building from alpine is something you don't want to do, then provide a
cloudflare tunnel health
command that can be used like soHEALTHCHECK --interval=5s --retries=6 --timeout=3s CMD cloudflare tunnel health --ready-endpoint localhost:2000/ready
or like so
Describe alternatives you've considered
Build my own image built on-top of the cloudflare/cloudflared image or use third-party images built on top of cloudflare's
The text was updated successfully, but these errors were encountered: