cli icon indicating copy to clipboard operation
cli copied to clipboard

Hardcode TF version to v1.13.4 for Docker build

Open pietern opened this issue 2 months ago β€’ 1 comments

Example how to use a later TF version in a Docker build.

Prerequisites

  • Go 1.25+ installed
  • Docker installed

Steps

1. Build the CLI binary

Build a static binary that can run in Alpine Linux:

CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o databricks

2. Build the Docker image

Build the Docker image with the desired architecture:

# For amd64
docker build -t databricks-cli --build-arg ARCH=amd64 .

# For arm64
docker build -t databricks-cli --build-arg ARCH=arm64 .

3. Verify the build

Test that the image works:

docker run --rm databricks-cli version

Notes

  • The static binary (CGO_ENABLED=0) is required because the Docker image uses Alpine Linux with musl libc
  • The Docker image includes Terraform v1.13.4 and the Databricks Terraform provider
  • Environment variables are pre-configured in the image:
    • DATABRICKS_TF_VERSION=1.13.4
    • DATABRICKS_TF_EXEC_PATH=/app/bin/terraform

pietern avatar Oct 21 '25 10:10 pietern

Run: 18681346917

Env πŸ”„β€‹flaky πŸ’šβ€‹RECOVERED πŸ™ˆβ€‹SKIP βœ…β€‹pass πŸ™ˆβ€‹skip
πŸ’šβ€‹ aws linux 1 1 321 561
πŸ’šβ€‹ aws windows 1 1 322 560
πŸ”„β€‹ aws-ucws linux 2 1 436 457
πŸ’šβ€‹ aws-ucws windows 1 1 438 456
πŸ’šβ€‹ azure linux 1 1 321 560
πŸ’šβ€‹ azure windows 1 1 322 559
πŸ’šβ€‹ azure-ucws linux 1 1 437 456
πŸ’šβ€‹ azure-ucws windows 1 1 438 455
πŸ”„β€‹ gcp linux 10 1 1 310 562
πŸ”„β€‹ gcp windows 5 1 1 316 561
18 failing tests:
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
TestAccept πŸ’šβ€‹R πŸ’šβ€‹R πŸ”„β€‹f πŸ’šβ€‹R πŸ’šβ€‹R πŸ’šβ€‹R πŸ’šβ€‹R πŸ’šβ€‹R πŸ’šβ€‹R πŸ’šβ€‹R
TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=direct-exp βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/deploy/files/no-snapshot-sync/DATABRICKS_BUNDLE_ENGINE=terraform βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/deploy/mlops-stacks βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct-exp βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/deployment/bind/job/job-spark-python-task βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/destroy/jobs-and-pipeline βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/resources/jobs/double-underscore-keys βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f
TestAccept/bundle/resources/jobs/double-underscore-keys/DATABRICKS_BUNDLE_ENGINE=terraform βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f
TestAccept/bundle/resources/synced_database_tables/basic πŸ™ˆβ€‹s πŸ™ˆβ€‹s πŸ”„β€‹f βœ…β€‹p πŸ™ˆβ€‹s πŸ™ˆβ€‹s βœ…β€‹p βœ…β€‹p πŸ™ˆβ€‹s πŸ™ˆβ€‹s
TestAccept/bundle/run/app-with-job πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S πŸ™ˆβ€‹S
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=yes/PY=no βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=yes βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=no βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f βœ…β€‹p
TestAccept/bundle/templates/default-python/integration_classic βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=terraform/UV_PYTHON=3.13 βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f
TestSyncIncrementalFileOverwritesFolder βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p βœ…β€‹p πŸ”„β€‹f

eng-dev-ecosystem-bot avatar Oct 21 '25 11:10 eng-dev-ecosystem-bot