= Cloud/Terraform/AwsLandingZoneTfctlDocker = * Docker container to run ruby for tfctl terraform wrapper {{{ FROM ruby:latest # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 #Install AWS cli RUN cd /tmp &&\ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip" &&\ unzip /tmp/awscliv2.zip -d /tmp/aws &&\ /tmp/aws/aws/install &&\ rm -rf /tmp/aws* # /usr/local/share/ca-certificates/ #RUN mkdir /usr/local/share/ca-certificates/mrp.net.nz COPY MRPENT-CA.crt MRPROOT-CA.crt /usr/local/share/ca-certificates/ RUN ls -l /usr/local/share/ca-certificates/ RUN apt-get update &&\ apt-get install -y lsb-release software-properties-common gnupg2 wget ca-certificates &&\ update-ca-certificates --fresh &&\ curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/hashicorp.com.gpg >/dev/null &&\ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" &&\ apt-get update &&\ apt-get install -y libxslt-dev libxml2-dev terraform vim &&\ apt-get clean WORKDIR /usr/src/app COPY Gemfile Gemfile.lock ./ RUN bundle install # Don't copy just mount dir in container #COPY . . # Set ENV AWS_PROFILE on container run CMD ["bash"] #Put this file in the root of your app, next to the Gemfile. #You can then build and run the Ruby image: # $ docker build -t myruby . # docker run -it -e AWS_PROFILE="$AWS_PROFILE" \ # -v "$HOME/.aws:/root/.aws" \ # -v "$PWD:/usr/src/app/" \ # myruby bash }}} ---- CategoryTerraform