GithubHelp home page GithubHelp logo

ubi-mirrors / docker-terraform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from broadinstitute/docker-terraform

0.0 1.0 0.0 63 KB

Docker container for running the Terraform application

Shell 48.78% Dockerfile 51.22%

docker-terraform's Introduction

broadinstitute/docker-terraform

Docker Hub

What is terraform

Terraform provides a common configuration to launch infrastructure from physical and virtual servers to email and DNS providers. Once launched, Terraform safely and efficiently changes infrastructure as the configuration is evolved.

Simple file based configuration gives you a single view of your entire infrastructure.

http://www.terraform.io/

Dockerfile

This Docker image is based on the official Alpine 3.2 base image.

Terraform configuration files

This container expects the user to mount in a directory, which will be mapped to the /data directory inside the container. This is the directory from which Terraform is configured to read the configuration files referenced by the commands you call.

How to run this image

For most terraform commands, the run command is as simple as:

docker run -it --rm broadinstitute/terraform [--version] [--help] <command> [<args>]

Some, however, require higher network privileges and SSL certificates to function correctly, which need to be mapped into the /etc/ssl/certs directory in the container, similar to:

docker run -it --rm -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform [--version] [--help] <command> [<args>]

Therefore, the repository used to build this container also contains a usedful terraform.sh script that will handle most of this so that the commands can be much shorter. All that is required is filling in a config.sh script so that the script will know where the /data directory is located as well as the path to the SSL certificates. The script will then determine whether each individual run requires the certificates as well as things like sudo, etc. Therefore, for the commands below, you could substitute the terraform.sh script for everything but the command and options. For example, if you have the config.sh correctly configured, you could do the following to run the apply command:

./terraform.sh apply [options]

terraform apply

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform apply [options]

terraform destroy

docker run -it --rm -v /data:/data broadinstitute/terraform destroy [options] [DIR]

terraform get

docker run -it --rm -v /data:/data broadinstitute/terraform get [options] PATH

terraform graph

docker run -it --rm -v /data:/data broadinstitute/terraform graph [options]

terraform init

docker run -it --rm -v /data:/data broadinstitute/terraform init [options] SOURCE [PATH]

terraform output

docker run -it --rm -v /data:/data broadinstitute/terraform output [options] NAME

terraform plan

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform plan [options]

terraform push

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform push [options]

terraform refresh

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform refresh [options]

terraform remote

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform remote [options]

terraform show

docker run -it --rm -v /data:/data broadinstitute/terraform show terraform.tfstate [options]

terraform taint

docker run -it --rm -v /data:/data -v /etc/ssl/certs:/etc/ssl/certs:ro --net=host broadinstitute/terraform taint [options] name

terraform version

docker run -it --rm broadinstitute/terraform version

docker-terraform's People

Contributors

coreone avatar rluckom avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.