pltf keeps Docker builds fast via Dagger cache layers and lets Terraform reuse its own provider cache inside the generated workspace.
Docker / BuildKit
- Image builds run through Dagger’s
Directory.DockerBuildwith a sharedpltf-image-cachevolume at/dagger/image-cache. pltf terraform planbuilds every declared image locally;pltf terraform applybuilds the images, pushes the tags using host registry credentials, and then runs Terraform;destroyskips image builds entirely.- Reusing the same context and Dockerfile lets BuildKit layers persist across commands and sessions, so both plan and apply benefit from cached layers.
Terraform cache
- Terraform executes on the host inside
.pltf/<environment_name>/workspace(env) or.pltf/<environment_name>/<service_name>/workspace(service), and its.terraformdirectory caches providers/plugins there. - Keep the workspace between runs (or share it across CI agents) to benefit from cached downloads; no extra
.terraform-plugin-cachefile or wrapper is required. - The workspace also stores plan artifacts (
.pltf-plan.tfplan,.pltf-plan.json) for downstream workflows orterraform showreferences.
Tips
- Inspect or archive the workspace directory if you need to copy provider binaries or debug plugin downloads.
- Ensure your host credentials (AWS, GCP, Azure, Docker) can read the generated workspace when sharing caches across teams.