Giter Club home page Giter Club logo

cloudnative-docker-cli's Introduction

Multicloud CLI Docker image

release License

The goal is to create a full feature but lightweight Docker image with several cloud native tools that helps its use in computer where installation of software is forbidden or complex.

Tools

What tools are included and ready to use:

How to use it

Launch the CLI

You just have to execute a Docker run:

```bash
docker run -it --rm ghcr.io/alvsanand/cloudnative-docker-cli:latest
```

The --rm flag will completely destroy the container and its data on exit.

If you want to execute it as a daemon and USER_HOME mounted in /data/home:

  • Create the container as daemon:

    # Windows (CMD)
    docker run --restart=always -d ^
      -v "%USERPROFILE%:/data/home" ^
      --name cloudnative-docker-cli ^
      ghcr.io/alvsanand/cloudnative-docker-cli:latest ^
      bash -c "while true; do sleep 10000; done"
    
    # Unix
    docker run --restart=always -d \
      -v "$HOME:/data/home" -u $(stat -c "%u:%g" $HOME) \
      --name cloudnative-docker-cli \
      ghcr.io/alvsanand/cloudnative-docker-cli:latest \
      bash -c "while true; do sleep 10000; done"
    
  • Execute a shell inside the container:

    # Windows (CMD)
    FOR /F "tokens=*" %g IN ('docker ps -aq --filter "name=cloudnative-docker-cli"') do (SET DOCKER_ID=%g)
    
    docker exec -it %DOCKER_ID% bash
    
    # Unix
    docker exec -it $(docker ps -aq --filter name=cloudnative-docker-cli) bash
    ```
    
  • If needed, delete the pod:

    # Windows (CMD)
    FOR /F "tokens=*" %g IN ('docker ps -aq --filter "name=cloudnative-docker-cli"') do (SET DOCKER_ID=%g)
    
    docker rm -f %DOCKER_ID%
    
    # Unix
    docker rm -f $(docker ps -aq --filter name=cloudnative-docker-cli)
    

A Docker container may be due to its stateless nature, so be sure to backup data frequently.

Additionally, you can add more parameters to Docker in order to add configuration to the commands. All will dependes of the tool. For example:

  • Set proxy:

    docker run -it --rm -e "HTTP_PROXY=SOME_PROXY_URL" -e "HTTPS_PROXY=SOME_PROXY_URL" -e "NO_PROXY=127.0.0.1,localhost,docker.host.internal" -v ${PWD}:/workspace ghcr.io/alvsanand/cloudnative-docker-cli:latest
    ```
    
  • Set AWS credentials using environment variables:

    docker run -it --rm -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" -v ${PWD}:/workspace ghcr.io/alvsanand/cloudnative-docker-cli:latest
    ```
    
  • Set AWS credentials using aws config:

    # Windows (CMD)
    docker run -it --rm  -v "%USERPROFILE%\\.aws:/home/cloudnative-docker-cli/.aws" workspace ghcr.io/alvsanand/cloudnative-docker-cli:latest
    
    # Unix
    docker run -it --rm  -v "$HOME/.aws:/home/cloudnative-docker-cli/.aws" workspace ghcr.io/alvsanand/cloudnative-docker-cli:latest
    

Finally, there is a Powershell script that could be used a templated to:

  • Run cloudnative-docker-cli as a daemon.
  • Mount several volumes by default.
  • Create a Windows Terminal Profile.
  • Using --restore parameter can restore to a default version of cloudnative-docker-cli.

Terraform

In order to change the version, execute the following command:

```bash
TF_VERSION=SOME_VERSION # Example: TF_VERSION=0.12

sudo tfenv install latest:$TF_VERSION && tfenv use latest:$TF_VERSION
```

cloudnative-docker-cli's People

Contributors

alvsanand avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jmhuertasg

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.