Git Product home page Git Product logo

ct-cloud-utils-dockerized's Introduction

NOTE: This repo is no longer maintained (archived/read-only)

ct-cloud-utils-dockerized

Various cloud utils (AWS CLI, aws-shell, awscli-login, Azure CLI, Terraform) in one Docker container.

About

What's Included

This is a base Python 3.7 base image that runs updates, sets timezone to Eastern, and installs the following:

Optionally installed (added at runtime based on config):

How to Use

  • Clone this repository down and go into the directory:

      git clone https://github.com/CU-CommunityApps/ct-cloud-utils-dockerized.git
      cd ct-cloud-utils-dockerized
  • Note: If you have an existing folder with files you want to use this with, copy the docker-compose.yml file to your folder and then proceed

Recommended usage (via docker-compose)

This will set some environment variables and if you haven't already set up awscli-login it will create a default config

  • Edit the docker-compose.yml file to set your preferences

    • Optionally disable awscli-login configuration - useful if using with a non-Cornell account where you'll connect with access keys and not use awscli-login
    • Optionally enable oh-my-zsh and/or fx
    • If enabled, container will start with a zsh shell instead of a bash shell
  • Bring a persistent container up:

      docker-compose up --detach
  • Attach to a shell:

    docker-compose exec cloud-utils configure-cloud-utils
  • Note: Last 2 steps can be called together:

      docker-compose up --detach && docker-compose exec cloud-utils configure-cloud-utils
  • You should now be able to run commands from any of the installed utilities (including aws, aws login, aws-shell, azure, and terraform)

  • Note: The container will remain running unless you manually stop it (this is useful if you want to return to a session with your prior setup, bash history, etc.) - reaatch to it with the following command:

      docker-compose exec cloud-utils bash
  • Stopping the container (after exiting it):

      docker-compose down
  • Check if you have any running containers:

      docker-compose ps
  • Alternative command to bring up a container that removes itself on exit:

      docker-compose run --rm cloud-utils configure-cloud-utils

Using without docker-compose

  • Note: If you want your container to persist, remove the --rm flag from the commands below

  • This command will mount your current directory as the working directory in the container:

      docker run --rm -it \
        -e SETUP_AWSCLI_LOGIN=true \
        -e DUO_FACTOR="auto" \
        -e NETID="" \
        -e SETUP_OHMYZSH=true \
        -e SETUP_FX=false \
        -v $HOME/.aws:/root/.aws \
        -v $HOME/.aws-login:/root/.aws-login \
        -v $PWD:/mounted-home \
        -w /mounted-home \
        mikesprague/cloud-utils
  • You can also alias the same command in your bash/zsh profile (bash via ~/.profile or ~/.bashrc or Zsh via ~/.zshrc) to simplify reuse:

      alias cloud-utils="docker run --rm -it \
        -e SETUP_AWSCLI_LOGIN=true \
        -e DUO_FACTOR="auto" \
        -e NETID="" \
        -e SETUP_OHMYZSH=true \
        -e SETUP_FX=false \
        -v $HOME/.aws:/root/.aws \
        -v $HOME/.aws-login:/root/.aws-login \
        -v $PWD:/mounted-home \
        -w /mounted-home \
        mikesprague/cloud-utils"
  • โ˜๏ธ The above snippet will make the command cloud-utils available in your shell and start the container in whatever directory you run the cloud-utils command

ct-cloud-utils-dockerized's People

Contributors

mikesprague avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dmore

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.