Giter Club home page Giter Club logo

macos-containerise's Introduction

macOS Containerise

1. Overview

I'm a big fan of containerisation and the more I use it the more I love the fact that you can segment packaging in order to not clutter your OS.

Take Ansible for e.g. where you need to install several packages so instead of cluttering my OS I run it directly from Docker.

2. Deployment

2.1. Verification

To verify that the functions are responsing to the base commands such as aws, terraform etc. use that which command.

which aws

This would result in you seeing the zsh function in the output rather than the path to the executable.

2.2. How to Use

I use dotfiles and keep configurations in a structure where in my case ZSH functions and customisations are located in ~/dotfiles/zsh/.zshrc/.

ln -s ~/git-repos/macos-containerise/functions-ansible.sh \
  ~/dotfiles/zsh/.zshrc.d/functions-ansible.zshrc
ln -s ~/git-repos/macos-containerise/functions-aws.sh \
  ~/dotfiles/zsh/.zshrc.d/functions-aws.zshrc
ln -s ~/git-repos/macos-containerise/functions-terraform.sh \
  ~/dotfiles/zsh/.zshrc.d/functions-terraform.zshrc
ln -s ~/git-repos/macos-containerise/functions-kubernetes.sh \
  ~/dotfiles/zsh/.zshrc.d/functions-kubernetes.zshrc

Rememver that every time you make a change to a function that's read by your shell you need to reload the sesison, e.g. for ZSH source ~/.zshrc".

3. Projects

3.1. Ansible

GitHub: https://github.com/davaba86/docker-ansible DockerHub: davaba/ansible

3.2. AWS CLI

When spawning a container from the official AWS image be aware of that your credentials need to be forwarded to the container.

I for e.g. use awsume to authenticate to AWS and once the ENV VARs are set I forward them to the container.

Have a look at functions-aws-cli.sh for more details on the usage.

3.3. Terraform

GitHub: https://github.com/davaba86/docker-terraform DockerHub: davaba/terraform

Since I use AWS I ensure the ENVs AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN as passed into the container from the host.

I recommend to use awsume to easely manage AWS profiles instead of creating your own scripts.

Also if you are triggering the commands from different paths then make use of -chdir and --terragrunt-working-dir.

terraform -chdir=infra-live-v2/dev/vpc init
terraform -chdir=infra-live-v2/dev/vpc apply -auto-approve
terragrunt init --terragrunt-working-dir infra-live-v3/dev/vpc
terragrunt apply --terragrunt-working-dir infra-live-v3/dev/vpc -auto-approve
terragrunt run-all destroy

3.4. Kubernetes

GitHub: https://github.com/davaba86/docker-kubernetes DockerHub: davaba/kubernetes

4. Future Work

  • Python
  • Firefox
  • Chrome
  • Spotify

macos-containerise's People

Contributors

davaba86 avatar

Watchers

 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.