A collection of build tools for the Mineiros Infrastructure as Code (IaC) library.
- Introduction
- Getting started
- Examples
- Module Versioning
- About Mineiros
- Reporting Issues
- Contributing
- Makefile Targets
- License
The main part of build-tools is a docker image that comes with install instructions for all necessary tools. Currently, we are installing the following dependencies:
In addition to the above listed technologies, build-tools ships with some pre-installed linters, that help you to ensure code quality and standards:
This repository ships with some pre-installed open-source software that help you to monitor security:
The easiest way to use build-tools is to pull the image from hub.docker.com.
The following command will pull the image from the registry and runs
terraform --version
inside a container.
docker run --rm \
mineiros/build-tools:latest \
terraform --version
The containers working directory is /build
which should be your target if
you decide to mount any files from your local filesystem.
Per default Terraform is configured to use /terraform
as its working
directory. This is configured through the TF_DATA_DIR
environment variable
and means that the .terraform
directory will be removed after
the container exits. We recommend creating a
named docker volume for the
/terraform
directory to re-use its content between different runs.
docker run --rm \
-v ${PWD}:/build \
-v terraform-working-directory:/terraform
mineiros/build-tools:latest \
terraform init
The working directory can be adjusted for a specific container through the
TF_DATA_DIR
environment variable.
docker run --rm \
-v ${PWD}:/build \
-e TF_DATA_DIR:/build
mineiros/build-tools:latest \
terraform init
Per default, Go is configured to use /go
as its working directory. This is
configured through the GO_PATH
environment variable/ We recommend creating
a named docker volume
for the /go
directory to re-use its content between
different runs.
docker run --rm \
-v ${PWD}:/build \
-v go-path-directory:/go \
mineiros/build-tools:latest \
go test ./test/...
The Go directory can be adjusted for a specific container through the
GO_PATH
environment variable.
docker run --rm \
-e GO_PATH=/build \
-v ${PWD}:/build \
mineiros/build-tools:latest \
go test ./test/...
Please see the following examples for common use-cases.
Mount the current working diretory as a volume and run terraform init
to
initialize the terraform working environment.
docker run --rm \
-v ${PWD}:/build \
mineiros/build-tools:latest \
terraform init
Mount the current working directory as a volume, pass AWS access credentials as
environment variables and run terraform init
. Requires
S3 to be configured as
the remote state backend.
docker run --rm \
-v ${PWD}:/build \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN \
mineiros/build-tools:latest \
terraform init
Mount the current working directory as a volume, pass AWS access credentials as
environment variables and run terraform plan --out=plan.tf
for creating a
plan file that we can use with the terraform apply
comand.
docker run --rm \
-v ${PWD}:/build \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN \
mineiros/build-tools:latest \
terraform plan -input=false -out=plan.tf
Mount the current working directory as a volume, pass AWS access credentials as
environment variables and run
terraform apply -auto-approve -input=false plan.tf
for applying changes.
docker run --rm \
-v ${PWD}:/build \
-e USER_UID=$(id -u) \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN \
mineiros/build-tools:latest \
terraform apply -input=false -out=plan.tf
Mounts the current working director as a volume and run go fmt
recursively.
docker run --rm \
-v ${PWD}:/build \
-e USER_UID=$(id -u) \
mineiros/build-tools:latest \
go fmt ./...
docker run --rm \
-v ${PWD}:/build \
-e USER_UID=$(id -u) \
mineiros/build-tools:latest \
checkov --directory ./
This Module follows the principles of Semantic Versioning (SemVer).
Using the given version number of MAJOR.MINOR.PATCH
, we apply the following constructs:
- Use the
MAJOR
version for incompatible changes. - Use the
MINOR
version when adding functionality in a backwards compatible manner. - Use the
PATCH
version when introducing backwards compatible bug fixes.
- In the context of initial development, backwards compatibility in versions
0.0.z
is not guaranteed whenz
is increased. (Initial development) - In the context of pre-release, backwards compatibility in versions
0.y.z
is not guaranteed wheny
is increased. (Pre-release)
Mineiros is a DevOps as a Service company based in Berlin, Germany. We offer commercial support for all of our projects and encourage you to reach out if you have any questions or need help. Feel free to send us an email at hello@mineiros.io.
We can also help you with:
- Terraform modules for all types of infrastructure such as VPCs, Docker clusters, databases, logging and monitoring, CI, etc.
- Consulting & training on AWS, Terraform and DevOps
We use GitHub Issues to track community reported issues and missing features.
Contributions are always encouraged and welcome! For the process of accepting changes, we use Pull Requests. If you'd like more information, please see our Contribution Guidelines.
This repository comes with a handy
Makefile.
Run make help
to see details on each available target.
This module is licensed under the Apache License Version 2.0, January 2004. Please see LICENSE for full details.
Copyright © 2020 Mineiros GmbH