Skip to content

Instantly share code, notes, and snippets.

@mkubenka
Created October 5, 2017 09:23
Show Gist options
  • Save mkubenka/6f951bba5b92aa9385115d73b5c34ae5 to your computer and use it in GitHub Desktop.
Save mkubenka/6f951bba5b92aa9385115d73b5c34ae5 to your computer and use it in GitHub Desktop.
Compiling Terraform Provider with Docker for OSX

Compiling Terraform Provider with Docker for OSX

Create binary terraform-provider-aws in current directory:

docker run \
  --rm \
  -v $(pwd):/go/src/github.com/terraform-providers/terraform-provider-aws \
  -w /go/src/github.com/terraform-providers/terraform-provider-aws \
  -e GOOS=darwin \
  -e GOARCH=amd64 \
  golang:latest \
  bash -c "apt-get update && apt-get install -y zip && make build && cp -f /go/bin/darwin_amd64/terraform-provider-aws ."

Copy binary to project directory .terraform/plugins/darwin_amd64 and run terraform init to update lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment