Skip to content

Terraform Docker Provider Build Context Extraction Fails Due to Compression Incompatibility #1583

@clementrey-dev

Description

@clementrey-dev

Describe the bug
When using the terraform-provider-docker (kreuzwerker) with Finch on MacOS, terraform apply fails with build context extraction errors. This appears to be related to recent changes in the provider that compress the build context by default.

Steps to reproduce

  1. Install Finch on MacOS
  2. Use terraform-provider-docker (kreuzwerker) in your Terraform configuration
  3. Run terraform apply

Expected behavior
The terraform apply command should execute successfully as it does when using Docker Desktop.

Screenshots or logs
Error from terraform:

Error running legacy build: Error response from daemon: failed to extract build context in temp folder

Finch logs (from limactl shell finch sudo journalctl -xeu finch@$UID):

Failed to extract build context in temp folder. Dir: /tmp/build-context2928056443, Error: exit status 2, Stderr: /usr/bin/gtar: Archive is compressed. Use -z option
/usr/bin/gtar: Error is not recoverable: exiting now

Additional context

  • This issue appears to be related to this change in the terraform-provider-docker: kreuzwerker/terraform-provider-docker@ae80eb7
  • Specifically, the change that compresses the build context by default: buildCtx, err = build.Compress(buildCtx)
  • The issue only occurs with Finch; works correctly with Docker Desktop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions