Sign inSign up

rommelag/gcloud-terraform-python

By rommelag

•Updated 10 days ago

docker including gcloud, terraform, packer and python

Image
0

10K+

rommelag/gcloud-terraform-python repository overview

⁠gcloud, terraform and python

Docker including gcloud, terraform and python

Useful to autodeploy jenkins agents via terraform (to google cloud)

Python is used for REST API calls to create/delete jenkins agents (includes: pip install joblib python-jenkins pylint)

⁠How?

docker pull rommelag/gcloud-terraform-python

⁠Jenkins process cancellation

The image includes procps. Jenkins Docker Pipeline uses ps -A -o pid,command e inside the container to locate processes when cancelling a shell step. Without it, cancellation fails with failed to run ps and container cleanup can kill Terraform before it saves state or releases its lock. The Docker build checks these exact ps options.

Build the patched image from branch terraform_1.16.5, based on terraform_1.16.4:

docker build --platform linux/amd64 \
	-t rommelag/gcloud-terraform-python:terraform_1.16.5 .
docker run --pull=never --rm --network none --entrypoint ps \
	rommelag/gcloud-terraform-python:terraform_1.16.5 -A -o pid,command e
docker run --pull=never --rm --network none --entrypoint terraform \
	rommelag/gcloud-terraform-python:terraform_1.16.5 version

After verification, publish explicitly:

docker push rommelag/gcloud-terraform-python:terraform_1.16.5

Publish before updating dependent Jenkins jobs to this tag. This fixes process discovery, but a real Jenkins cancellation test must still confirm graceful Terraform shutdown and state-lock release before the container is removed.

Tag summary

Content type

Image

Digest

sha256:c4f41a4cc…

Size

386.6 MB

Last updated

10 days ago

docker pull rommelag/gcloud-terraform-python