https://pulumi.com logo
g

great-tomato-45422

12/20/2019, 7:26 PM
is there a way to do pulumi preview without it building containers?
👋 1
w

white-balloon-205

12/20/2019, 7:30 PM
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

handsome-actor-1155

12/20/2019, 7:39 PM
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

white-balloon-205

12/20/2019, 8:30 PM
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

handsome-actor-1155

12/20/2019, 8:31 PM
It still runs through the steps, just doesn’t actually rebuild due to caching, correct?
And yes, that’s what he is asking.
w

white-balloon-205

12/20/2019, 8:33 PM
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

handsome-actor-1155

12/20/2019, 8:38 PM
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

great-tomato-45422

12/20/2019, 8:40 PM
yea my pipeline is generally, build, preview dev/prod/stage then apply dev/prod/stage do some reason my preview step is building again