Skip to content
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

Support docker healthchecks #8208

Open
1 task done
bgelens opened this issue Mar 20, 2025 · 3 comments
Open
1 task done

Support docker healthchecks #8208

bgelens opened this issue Mar 20, 2025 · 3 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-orchestrator
Milestone

Comments

@bgelens
Copy link

bgelens commented Mar 20, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

container images can have a healthchecks provided https://docs.docker.com/reference/dockerfile/#healthcheck

when the container is started, docker will call it and make the state available like so:

docker inspect --format='{{json .State.Health}}' 56c0067882aa
{"Status":"healthy","FailingStreak":0,"Log":[{"Start":"2025-03-20T10:08:53.524705545Z","End":"2025-03-20T10:08:53.588649253Z","ExitCode":0,"Output":""},{"Start":"2025-03-20T10:09:23.592720711Z","End":"2025-03-20T10:09:23.643875336Z","ExitCode":0,"Output":""},{"Start":"2025-03-20T10:09:53.646527211Z","End":"2025-03-20T10:09:53.695310628Z","ExitCode":0,"Output":""},{"Start":"2025-03-20T10:10:23.696539837Z","End":"2025-03-20T10:10:23.742670003Z","ExitCode":0,"Output":""},{"Start":"2025-03-20T10:10:53.745960878Z","End":"2025-03-20T10:10:53.795057462Z","ExitCode":0,"Output":""}]}

when a healthchecks is made available like this, it is executable based (no http endpoint available)

Describe the solution you'd like

it would be really nice if Aspire could support these docker provided healthchecks natively or allow Aspire healthchecks that call into the container executables themselves.

I investigated a little bit and it is pretty hard to get the container id or name from Aspire due to DcpInstancesAnnotation being internal.

Additional context

No response

@davidfowl
Copy link
Member

@danegsta this is supported in dcp right? We just need to expose it?

@danegsta
Copy link
Member

@davidfowl

I think there’s two different scenarios here:

  1. The Docker healthcheck functionality

We don’t currently expose the detailed status from the Docker managed health checks, but it makes sense to add that. I’ll open a work item.

  1. Aspire health checks that execute in a container

We do have a container exec model in place that can be integrated with the existing Aspire health checks.

@davidfowl
Copy link
Member

Seems like we could marry the 2

@karolz-ms karolz-ms added this to the Backlog milestone Mar 24, 2025
@dbreshears dbreshears added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-orchestrator
Projects
None yet
Development

No branches or pull requests

5 participants