|
| 1 | +# Cloud-Native Toolkit cli tools |
| 2 | + |
| 3 | +[](https://quay.io/repository/cloudnativetoolkit/cli-tools-core) |
| 4 | + |
| 5 | +This repository builds a Docker image whose container is a client for interacting with different cloud providers (IBM Cloud, AWS, Azure). |
| 6 | + |
| 7 | +The container includes the following tools: |
| 8 | + |
| 9 | +- bash |
| 10 | +- terraform cli |
| 11 | +- terragrunt cli |
| 12 | +- kubectl cli |
| 13 | +- oc cli |
| 14 | +- git cli |
| 15 | +- perl cli |
| 16 | +- jq cli |
| 17 | +- yq3 cli |
| 18 | +- yq4 cli |
| 19 | +- helm cli |
| 20 | + |
| 21 | +**Warning: The material contained in this repository has not been thoroughly tested. Proceed with caution.** |
| 22 | + |
| 23 | +## Getting started |
| 24 | + |
| 25 | +### Prerequisites |
| 26 | + |
| 27 | +To run this image, the following tools are required: |
| 28 | + |
| 29 | +- `docker` cli |
| 30 | +- `docker` backend - Docker Desktop, colima, etc |
| 31 | + |
| 32 | +### Running the client |
| 33 | + |
| 34 | +Start the client to use it. |
| 35 | + |
| 36 | +- To run the `toolkit` container: |
| 37 | + |
| 38 | + ```bash |
| 39 | + docker run -itd --name toolkit quay.io/cloudnativetoolkit/cli-tools-core |
| 40 | + ``` |
| 41 | + |
| 42 | +Once the client is running in the background, use it by opening a shell in it. |
| 43 | + |
| 44 | +- To use the `toolkit` container, exec shell into it: |
| 45 | + |
| 46 | + ```bash |
| 47 | + docker exec -it toolkit /bin/bash |
| 48 | + ``` |
| 49 | + |
| 50 | + Your terminal is now in the container. |
| 51 | + |
| 52 | +Use this shell to run commands using the installed tools and scripts. |
| 53 | + |
| 54 | +When you're finished running commands, to exit the client. |
| 55 | +
|
| 56 | +- To leave the `toolkit` container shell, as with any shell: |
| 57 | +
|
| 58 | + ```bash |
| 59 | + exit |
| 60 | + ``` |
| 61 | +
|
| 62 | + The container will keep running after you exit its shell. |
| 63 | +
|
| 64 | +If the client stops: |
| 65 | +
|
| 66 | +- To run the `toolkit` container again: |
| 67 | +
|
| 68 | + ```bash |
| 69 | + docker start toolkit |
| 70 | + ``` |
| 71 | +
|
| 72 | +The `toolkit` container is just a Docker container, so all [Docker CLI commands](https://docs.docker.com/engine/reference/commandline/cli/) work. |
| 73 | +
|
| 74 | +## Development |
| 75 | +
|
| 76 | +### Prerequisites |
| 77 | +
|
| 78 | +To use/build this image, the following tools are required: |
| 79 | +
|
| 80 | +- `Docker` - kinda obvious, but since we are building, testing and running a Docker image, you need to have |
| 81 | +the tool available |
| 82 | +- `node/npm` - (optional) used to consolidate the configuration and scripts for working with the image, it |
| 83 | +is **highly** recommended that `npm` is used; however, it is possible to run the scripts directly by looking |
| 84 | +at `package.json` and providing the appropriate values |
| 85 | +
|
| 86 | +### Using the image |
| 87 | +
|
| 88 | +To use the image, a local image of the tool is required. You can get the image either by pulling from Docker Hub or |
| 89 | +building locally: |
| 90 | +
|
| 91 | +```bash |
| 92 | +npm run pull |
| 93 | +``` |
| 94 | +
|
| 95 | +**OR** |
| 96 | +
|
| 97 | +```bash |
| 98 | +npm run build |
| 99 | +``` |
| 100 | +
|
| 101 | +After that, start the image in an interactive terminal with: |
| 102 | +
|
| 103 | +```bash |
| 104 | +npm start |
| 105 | +``` |
| 106 | +
|
| 107 | +### File Layout |
| 108 | +
|
| 109 | +- `package.json` - scripts and config for the image build |
| 110 | +- `Dockerfile` - the docker image definition |
| 111 | +- `config.yaml` - the test config file for the `container-structure-test` tool |
| 112 | +- `scripts/` - directory for shell scripts used by `package.json` scripts to build, test, and |
| 113 | +push the image |
| 114 | +- `src/` - directory containing files that should be included in the built image |
0 commit comments