adventurous-solstice-70914
09/18/2024, 4:48 PMprovider = docker_build.Provider("test-provider", host="unix:///var/run/docker.sock")
image = docker_build.Image(
"test-image",
context=dict(location="."),
dockerfile=dict(location="./Dockerfile"),
platforms=[docker_build.Platform.LINUX_AMD64],
tags=["test-image"],
push=False,
opts=pulumi.ResourceOptions(provider=provider),
exports=[{"docker": {'tar': True}}],
)
Can someone advise me on how to properly configure the inputs to docker_build.Image
? Especially the exports
parameter, if I don't set it, the output digest
is an empty string. I am just interested in a simple docker build, nothing fancy.
And by the way, do you recommend building images through pulumi at all?fast-ram-96156
09/18/2024, 8:32 PMdigest
is "A SHA256 digest of the image if it was exported to a registry or elsewhere.
Empty if the image was not exported." So maybe your image is not being exported properly. And perhaps that's because exports
parameter is incorrect. Are you just trying to build an image locally? If so I think you don't even need to provide exports
and Pulumi will default to building and saving the image locally.
As for your second question, I think it depends on your workflow. If you want to control every aspect of a container lifecycle through IaC then it's probably a good idea to build images with Pulumi, deploy them as containers with Pulumi, and so on.melodic-tailor-66495
09/19/2024, 12:32 AMadventurous-solstice-70914
09/19/2024, 8:54 AMdocker.Container
😅
Anyhow I'm just testing locally for now, I will in the future export the built images to a repository, which I guess will solve my problem.
As for my second question, I'm working on a small scale project where I have the opportunity to revamp the whole architecture. I will use pulumi to build the images then!
Thanks for your help 😉melodic-tailor-66495
09/20/2024, 12:33 AM