From 8cb4c8d62e6c5cf965298d665d3ee937c638d60a Mon Sep 17 00:00:00 2001 From: Taufek Johar Date: Sat, 23 Sep 2017 15:04:36 +0800 Subject: [PATCH] Add Terraform to Workspace Added Terraform (www.terraform.io) binary to workspace container. This tool is useful to spawn resources to multiple cloud providers via config files. --- docker-compose.yml | 1 + env-example | 1 + workspace/Dockerfile-56 | 15 +++++++++++++++ workspace/Dockerfile-70 | 15 +++++++++++++++ workspace/Dockerfile-71 | 15 +++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b44e8b77..1940b860 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ services: - INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON} - INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS} - INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK} + - INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - NODE_VERSION=${WORKSPACE_NODE_VERSION} diff --git a/env-example b/env-example index 7357b3ef..b026ae7c 100644 --- a/env-example +++ b/env-example @@ -51,6 +51,7 @@ WORKSPACE_INSTALL_SYMFONY=false WORKSPACE_INSTALL_PYTHON=false WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false WORKSPACE_INSTALL_IMAGEMAGICK=false +WORKSPACE_INSTALL_TERRAFORM=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 WORKSPACE_NODE_VERSION=stable diff --git a/workspace/Dockerfile-56 b/workspace/Dockerfile-56 index bac3ee92..a3885523 100644 --- a/workspace/Dockerfile-56 +++ b/workspace/Dockerfile-56 @@ -509,6 +509,21 @@ RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ apt-get install -y --force-yes imagemagick php-imagick \ ;fi +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-70 b/workspace/Dockerfile-70 index 20188169..297d26df 100644 --- a/workspace/Dockerfile-70 +++ b/workspace/Dockerfile-70 @@ -590,6 +590,21 @@ RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ apt-get install -y --force-yes imagemagick php-imagick \ ;fi +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index aeaec9c0..a57bff60 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -596,6 +596,21 @@ RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ apt-get install -y --force-yes imagemagick php-imagick \ ;fi +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + # #-------------------------------------------------------------------------- # Final Touch