is there a way to do pulumi preview without it bui...
# general
g
is there a way to do pulumi preview without it building containers?
đź‘‹ 1
w
Possibly - depends on what approach you are taking to the Docker build. You could conditionally create the “Image” on
pulumi.runtime.isDryRun()
and then if it is a dryrun(preview) pass a dummy value as the image name instead of the name generated by the Image? (The preview may show a false-positive removal of the Image).
That said - it might be nice to have some more direct way to do this. If you want to open an issue to suggest this - would be good to track.
h
Alternatively, could this be flipped so that it only builds on preview then only deploys on when
up
or
update
is accepted? Similar to how there is an issue tracking the ability to only apply what was generated during the preview step. So, you run
pulumi update
get the preview, pulumi builds the docker images, then when
yes
is selected, it applies what it did during the preview stage so a change to a dockerfile in between preview and apply won’t change the image.
w
Only build on preview and deploy on update is the current behavior. With Docker caching I think @great-tomato-45422 is asking to not even build on preview?
h
It still runs through the steps, just doesn’t actually rebuild due to caching, correct?
And yes, that’s what he is asking.
w
Technically it always rebuilds both on preview and update - but due to caching both of them should be “fast” if there are not actually any changes.
There are a few issues in https://github.com/pulumi/pulumi-docker/issues related to improvements that we can make around this.
h
I think this one is most similar to what I was talking about: https://github.com/pulumi/pulumi-docker/issues/32
Good to know it’s being tracked!
g
yea my pipeline is generally, build, preview dev/prod/stage then apply dev/prod/stage do some reason my preview step is building again