dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.91k stars 476 forks source link

Some ContainerExec experimentation. #6481

Closed mitchdenny closed 1 day ago

mitchdenny commented 1 month ago

Something to look at post 9.0.

This is just a draft PR for some discussion. In the DCP types we have ContainerExec. It allows us to invoke a command against an existing container. I'm thinking it might enable us to do things like run backup/restore commands inside container images.

This would allow for some interesting advanced scenarios such as triggering a backup/restore of a postgres database using something like pg_dump within the container (the file would be copied to a databindmount.

@danegsta @karolz-ms @DamianEdwards @davidfowl @drewnoakes @JamesNK @adamint

Microsoft Reviewers: Open in CodeFlow
mitchdenny commented 1 month ago

I should note that PgAdmin allows you to backup and restore databases but the idea here is that you could do things like automate the restore of a database from a known baseline.