https://pulumi.com logo
#python
Title
# python
c

colossal-room-15708

09/08/2019, 4:52 AM
Trying to build a full demo of a containerised app. Does the python library not support building docker images yet? Seems like it can only work with existing images at the moment, but not build new ones.
h

high-translator-22614

09/09/2019, 5:11 PM
no,
pulumi_docker
does not exist for Python yet
oh, nvm, i see it in PyPI and github, but not pulumi's website
imho, don't do that anyway? Pulumi isn't meant to be a general-purpose build tool? idk, I'm doing a similar thing with lambda packages, so 🤷
🤔
now you got me wondering about that
because in my ideal world, I would have a bunch of stuff built by various pipelines and then pulled in and tied together by pulumi, but wooph that sounds like a mountain of work
also, my lambda stuff integrates with pulumi (passes resources into it, and some codegen), so what i just described is only sorta possible
c

colossal-room-15708

09/09/2019, 8:46 PM
Yeah, which is why I was wondering if I could use pulumi. It's in the TS library, but not in python yet it seems. @white-balloon-205 any idea when this might change?
w

white-balloon-205

09/09/2019, 10:21 PM
We are considering re-writing the
docker.Image
component to be a native component so that it can more easily fit into deployment lifecycle (a few of the issues in that repro are blocked on doing this before we can address them properly). Doing so would also make this available in Python. But this library is also just some convenience wrappers - you can do the same yourself if you want for targeted use cases - or port some/all of the existing library there to Python. So definitely these same scenarios are possible in Python as well - and we hope to have the exact same libraries also available in the future.
c

colossal-room-15708

09/09/2019, 10:42 PM
Cool, this is for a conference demo, I assume I can just call the docker binary from python to build and push the image inline with the rest of the code.
This wouldn't be a managed pulumi resource then, right?
w

white-balloon-205

09/09/2019, 10:51 PM
In
docker.Image
it is done inside a resource, but you don’t really have to. You could just have a function which invokes
docker build
and conditionally
docker push
only when not in preview.
c

colossal-room-15708

09/09/2019, 10:55 PM
👍 thanks Luke. What I expected.
2 Views