A docker image that contains tools used to build and deploy Terraform modules.
- terraform
- terraform-docs
- git-chglog
- aws-cli
Makefile:
apply:
docker-compose run --rm terraform-utils terraform applydocker-compose:
services:
terraform-utils:
image: deanillfeld/docker-terraform-utils:latest
volumes:
- .:/code
- ~/.aws:/root/.aws
- ~/.ssh:/root/.ssh
working_dir: /codeIf you have SELinux enabled volume mounts are a bit more complicated. You have 2 options to get around permission denied errors with docker-compose.
Option 1 - Use :Z to automatically relabel files
This will remove the existing label on files/directories which may break things
volumes:
- ~/code:/code:Z
- ~/.aws:/root/.aws:ZOption 2 - Disable SELinux for the container
security_opt:
- label:disableDockerHub should automatically build and test on commit. Tests can be run locally with make test. Containers are not automatically cleaned up in the event of test failure. Run make clean when you are finished investigating the test failure.