https://pulumi.com logo
Title
m

miniature-leather-70472

08/08/2022, 3:07 PM
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

bored-oyster-3147

08/08/2022, 5:25 PM
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

miniature-leather-70472

08/08/2022, 5:55 PM
Awesome, thanks for that, will give that a go
w

worried-city-86458

08/08/2022, 7:31 PM
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

little-cartoon-10569

08/08/2022, 8:41 PM
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

bored-oyster-3147

08/08/2022, 8:52 PM
@little-cartoon-10569 I believe the pulumi .NET container contains the full SDK and not just the runtime
w

worried-city-86458

08/08/2022, 8:52 PM
You probably want to build your own image, so use these as starting points.
l

little-cartoon-10569

08/08/2022, 8:53 PM
The base image doesn't include the SDK.
w

worried-city-86458

08/08/2022, 9:01 PM
Also, you don't need the dotnet plugin when using the automation api. (I only extract the pulumi executable.)