Dojo docker image with Terraform and supporting tools installed. Based on alpine docker image.
Tested and released images are published to dockerhub as kudulab/terraform-dojo
- Setup docker.
- Install Dojo binary.
- Provide a Dojofile:
DOJO_DOCKER_IMAGE="kudulab/terraform-dojo:latest"
- Create and enter the container by running
dojo
at the root of project. - Work with terraform as usual:
terraform --version
terraform init
terraform plan
By default, current directory in docker container is /dojo/work
.
- base image is alpine, to make this image as small as possible
- terraform binary on the PATH
- terraform plugins: consul, openstack, aws, null, external, local, template, vault.
jq
to parse JSON from bash scriptsdot
to generate infrastructure graphs from terraform- a minimal ssh and git setup - to clone terraform modules
Those files are used inside the docker image:
~/.ssh/
-- is copied from host to dojo's home~/.ssh
~/.ssh/config
-- will be generated on docker container start. SSH client is configured to ignore known ssh hosts.~/.aws/
-- is copied from host to dojo's home~/.aws
~/.gitconfig
-- if exists locally, will be copied~/.profile
-- will be generated on docker container start, in order to ensure current directory is/dojo/work
.- For openstack access - environment variables must be locally set:
[ 'OS_AUTH_URL', 'OS_TENANT_NAME', 'OS_USERNAME', 'OS_PASSWORD']
. Dojo will pass them to the docker image. - For AWS access
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
must be set.
To enable debug output:
OS_DEBUG=1 TF_LOG=debug
So that packer-dojo and terraform-dojo are similar and thus easier to maintain.
- Bash
- Docker daemon
- Dojo
Full spec is ops-base
Instructions how to update this project.
- Create a new feature branch from the main branch
- Work on your changes in that feature branch. If you want, describe you changes in CHANGELOG.md
- Build your image locally to check that it succeeds:
./tasks build
- Test your image locally:
./tasks itest
. You may need to install the test framework - you can do it withsudo ./tasks install_bats
- If you are happy with the results, create a PR from your feature branch to master branch
After this, someone will read your PR, merge it and ensure version bump (using ./tasks set_version
). CI pipeline will run to automatically build and test docker image, release the project and publish the docker image.
Copyright 2019-2022 Ava Czechowska, Tom Setkowski
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.