https://pulumi.com logo
Title
f

full-artist-27215

05/06/2021, 3:27 PM
Is there a way to refer to an existing container image on the local host in order to, say, push it to a remote repository during a Pulumi run, but not build that image during the Pulumi run? https://www.pulumi.com/docs/reference/pkg/docker/image/ looks close, but seems to require the building of the image. I'd like to be able to decouple image building from infrastructure provisioning.
t

tall-scientist-89115

05/06/2021, 5:48 PM
hey, I recently dealt with this, you might find this thread useful: https://pulumi-community.slack.com/archives/C84L4E3N1/p1619604843101500
f

full-artist-27215

05/06/2021, 6:01 PM
@tall-scientist-89115 Hrmm... interesting. Did you ever find this
docker.Image.get()
function?
At the moment, I'm thinking I may just need to handle image upload to the repository outside of Pulumi 😕
👍 1
p

proud-art-41399

05/06/2021, 6:03 PM
For me, that would be the best option (because of caching etc.) But I just haven't found any example of referencing the image in remote repository in the Pulumi program once it's pushed there.
f

full-artist-27215

05/06/2021, 6:06 PM
@proud-art-41399 I would have guessed that's what RegistryImage or RemoteImage would be for (but like you said in that thread, I'd be hard-pressed to explain the difference between those 🤷 )
p

proud-art-41399

05/06/2021, 6:07 PM
Yeah I think it will just have to try these two
t

tall-scientist-89115

05/06/2021, 6:20 PM
yeah the best I've got right now speed wise is using github actions then just using an environment variable for the github build number, equivalent to the commit hash in terms of unnecessary deployment rollouts (since I'm using a mono repo). Ideally I could push the image hash downstream somehow and just use that with the DEPLOY_ENV but haven't figured that out yet
p

proud-art-41399

05/07/2021, 4:30 AM
Can't you just pass it via env variable as well?