Hi there! I'm trying to run Pulumi (GCP-Python) in...
# getting-started
b
Hi there! I'm trying to run Pulumi (GCP-Python) inside a Docker container running on Docker Desktop on a Mac host machine. I started with the very basic example Pulumi creates after
pulumi new gcp-python
. The example runs fine when I run it on the host machine. It results in an error when I run it in a docker container and, from my little experience with Pulumi's internals, it seems to be an issue with some background process that unexpectedly dies. The logs from running
pulumi preview -s dev -v 9 --logflow
are in the attached file. If relevant, the Dockerfile starts the image from Debian base image, installs (pyenv and then python 3.12) and finally pulumi via the recommended
curl
method I couldn't find anything related to this error searching the web or here in Slack. Has anyone faced this before?
v
Looks to me like you’re not port forwarding from the container to the host machine, see the connection refused errors
b
Interesting. I was expecting all Pulumi related processes to be running inside the container, with no dependencies on the host machine. I can connect to GCP from the container, as executing
gcloud
commands works as expected. I'll look into these network settings. Thanks @victorious-church-57397! I'll also check the pulumi-docker-container image from https://github.com/pulumi/pulumi-docker-containers/tree/main/docker/python
v
It would be useful to check the grpc server is running in the container and on what port - sorry just re read the errors
b
I've found the root cause is the container's networking setup. This container is part of a multi-service docker compose setup. The container running Pulumi had
network_mode: host
instead of the default
bridge
for some other reasons. Apparently this messes up the gRPC components required by Pulumi.