Skip to content

Instantly share code, notes, and snippets.

@wheelq
Last active March 28, 2020 11:56
Show Gist options
  • Save wheelq/312075580ebfdb9cf5d4ec53a183c30f to your computer and use it in GitHub Desktop.
Save wheelq/312075580ebfdb9cf5d4ec53a183c30f to your computer and use it in GitHub Desktop.
Alias for terraform from docker
#echo "alias terraform=' function __terraform(){ docker run --rm -v \"\${PWD}:/src\" -w /src -v ~/.terraform.d:/root/.terraform.d -it hashicorp/terraform:light \$@;unset -f __terraform;}; __terraform'"|tee -a ~/.bash_profile >> ~/.bashrc
echo -e "#\!/usr/bin/env bash\nfunction __terraform(){ docker run --rm -v \"\${PWD}:/src\" -w /src -v ~/.terraform.d:/root/.terraform.d -it hashicorp/terraform:light \$@;unset -f __terraform;}; __terraform \$@" >/usr/local/bin/terraform && chmod 755 /usr/local/bin/terraform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment