Coder Social home page Coder Social logo

dockerfiles's Introduction

dockerfiles

Docker build

docker build --pull -t aws:latest -f aws.Dockerfile .
docker build --pull -t terraform:1.3.9 -f terraform.Dockerfile .
docker build --pull -t cdk:latest -f cdk.Dockerfile .
docker build --pull -t ansible:latest -f ansible.Dockerfile .
docker build -t devops:latest -f devops.Dockerfile .

Alias

alias aws='docker run --rm -v ~/.aws:/root/.aws -v `PWD`:/app -it aws:latest'
alias terraform='docker run --rm -v ~/.aws:/root/.aws -v `PWD`:/app -it terraform:1.3.9'
alias cdk='docker run --rm -v ~/.aws:/root/.aws -v `PWD`:/app -it cdk:latest'
alias ansible='docker run --rm -v ~/.aws:/root/.aws -v `PWD`:/app -it ansible:latest'

.zshrc entries - Shell Functions

check_devops_container() {
    # Check if a container with the name "devops" is running
    if ! docker ps --format '{{.Names}}' | grep -q devops; then 
        # Check if a container with the name "devops" is stopped
        if docker ps -a --filter "name=devops" --filter "status=exited" | grep -q devops; then
            # Start the stopped devops container
            docker start devops >/dev/null
        else
            # Start the devops container
            docker run -d -v "$HOME"/.aws:/root/.aws -v "$(pwd)":/app  --name devops devops:latest >/dev/null
        fi
    fi

    cmd="docker exec -it devops $@"
    eval $cmd
}

aws() { check_devops_container "$0 $*" }
terraform() { check_devops_container "$0 $*" }
cdk() { check_devops_container "$0 $*" }
ansible() { check_devops_container "$0 $*" }
node() { check_devops_container "$0 $*" }
custodian() { check_devops_container "$0 $*" }

dockerfiles's People

Contributors

bheesma 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.