I'm looking to run a dotnet C# pulumi program in a...
# automation-api
m
I'm looking to run a dotnet C# pulumi program in a docker conatainer using the automation API. As far as I can tell I need to have the .net SDK installed, rather than just the run time to do this, as Pulumi compiles the program at run time, is this correct? Is there anyway to pre-compile the program at container creation time to help reduce the size?
b
yes you can pre-compile for both Golang and .NET and provide the path to your pre-built binary in your project settings
And Java now, apparently. See here: https://www.pulumi.com/docs/reference/pulumi-yaml/ Under
runtime:options
m
Awesome, thanks for that, will give that a go
w
That's what I do in https://github.com/gitfool/Pulumi.Dungeon/blob/main/Cli/Dockerfile (derives from dotnet/runtime-deps since it builds a single file executable)
l
If you're looking to use images, Pulumi publishes lang-specific ones on Docker Hub.
Looks like this is the one you want: https://hub.docker.com/r/pulumi/pulumi-dotnet
b
@little-cartoon-10569 I believe the pulumi .NET container contains the full SDK and not just the runtime
w
You probably want to build your own image, so use these as starting points.
l
The base image doesn't include the SDK.
w
Also, you don't need the dotnet plugin when using the automation api. (I only extract the pulumi executable.)