[How To] Install Linux Dependencies in Container #4112
-
Hi Folks! Until now, I've always have been able to just install my required Linux dependencies at the top of my Dockerfile in the However, I can't find a way to do this when building a .NET Aspire project 🙁 AttemptsI tried finagling it by defining a command in the aspire-manifest, but it's not an option when using a "project.v0" type (I only see expressing args when using the "docker.v0" type). A better question might be "Can I run a bash command when a .NET Aspire container is first created?". Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 40 replies
-
I assume when running locally these are no issue as this is an ASP.NET project right? And you want to eliminate your previous dockerfile? |
Beta Was this translation helpful? Give feedback.
-
There is no Dockerfile right now, it's using the default You can see everything here => https://github.com/LanceMcCarthy/DevCraftAspire |
Beta Was this translation helpful? Give feedback.
-
To explain a little further, my API project has a That needs the following Linux dependencies to be available at runtime:
I have no problem meeting this requirement when I'm deploying a standard ASP.NET project with a Dockerfile. Here's a great real-world example wher eI use Dockerfile to meet this requirement. Proving that it works, you can spin up the image using the Dockerhub
the problem arises when I am using Aspire to create the image. Where can I tell .NET to include those two dependencies in the image? |
Beta Was this translation helpful? Give feedback.
-
A while ago I opened this issue to support dockerfiles in Aspire instead of just relying on images. IMO this would simplify this scenario as well. Creating an intermediate image is good when you consolidate, but certainly not in the developer loop which is where Aspire should provide the stronger support. |
Beta Was this translation helpful? Give feedback.
Ok, chatting with a few folks, you'd have to rely on a base image that has these dependencies already (assuming you don't want to use a dockerfile). So you'd need an image that is your aspnet+dependencies added, then can set that as containerbaseimage in the web project and the rest of the workflow would work.