This message was deleted.
# general
s
This message was deleted.
l
Most likely, you're creating a new container each time.
You could possibly stop/start it, but usually the best thing is to mount a volume or bind mount to retain all the transient stuff (e.g. node_modules) that you might want to keep between runs.
f
container is already built, I’m not recreating it. I’m having a volume for
node_modules
everything else is fine but pulumi plugins.
l
You mean the image is already built? It's probable that you're creating a new container each time. If not, can you share how you're re-starting the same container each time?
The directory that you would need to add as a volume for Pulumi plugins is ~/.pulumi/
f
I’m using
docker-compose
to run the container, it’s not recreated at each run, the volume with the modules is persistent, no issue on that part.
The directory that you would need to add as a volume for Pulumi plugins is ~/.pulumi/
ok that’s something I can use, thanks
l
You're execing into the container and just re-running pulumi from inside a single long-lived instance of the container? Something must be clearing out your ~/.pulumi directory then.
If you're running
docker-compuse up
or
docker-compose run
repeatedly, then you're getting new containers each time, and the ~/.pulumi directory will be new each time, which would explain what you're seeing.
f
yep, so that’s what I was looking for, why plugins are not already installed during the container build, and what I should do about it. I can add a new volume for this one, but that wasn’t documented anywhere and not really something you can guess
l
The images are built mostly to be used in CI, with the intention that you would suck everything down fresh each time, or else use your CI-providers capabilities to save persistent directories and artifacts. Those of us brave enough to use the images interactively take on a certain burden of knowledge 🙂
f
I can see that. That’s temporary, we are experiencing with the container locally but ultimately it will go in CI.
l
You could build your own image from your docker-compose.yml, and run
pulumi install
and
pulumi login
during the build. That would save effort.
f
One thing I can’t figure out is why the plugins are installed during my first execution of the container (they are properly cached with the volume now at the second run) while they should have already been installed during the build.
l
As I understand it, they're not installed until you run
pulumi plugin install
. Since the plugins can be updated much more frequently than the pulumi image, they have to let you do it ad hoc.
They can't know which plugins or version you need.
f
makes sense, thanks for your help sorting this out !
b
Thanks for the great explanations @little-cartoon-10569 ! @faint-motherboard-95438 does this answer all your questions?
f
@billowy-army-68599 yes, I was just not able to locate the plugins and ensure their persistence, but with @little-cartoon-10569 help now everything is fine, thanks