Skip to content

Commit 7253321

Browse files
committed
Update README.md
1 parent 05eb191 commit 7253321

5 files changed

Lines changed: 249 additions & 101 deletions

File tree

.github/workflows/codacy.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Release
22

33
on:
4-
schedule:
5-
- cron: '0 10 */5 * *'
6-
release:
7-
types: [created]
4+
push:
5+
branches:
6+
- main
87

98
env:
109
REGISTRY_HOSTNAME: oda2
@@ -23,7 +22,7 @@ jobs:
2322
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
2423

2524
- name: Login to DockerHub
26-
uses: docker/login-action@v1
25+
uses: docker/login-action@v1
2726
with:
2827
username: ${{ secrets.DOCKERHUB_USERNAME }}
2928
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -34,12 +33,3 @@ jobs:
3433
with:
3534
push: true
3635
tags: oda2/ibmcloud-cli:latest
37-
38-
# - name: Push to GitHub Packages
39-
# uses: docker/build-push-action@v2
40-
# with:
41-
# username: ${{ github.actor }}
42-
# password: ${{ secrets.GITHUB_TOKEN }}
43-
# registry: docker.pkg.github.com
44-
# repository: oda2/docker-ibmcloud-cli:latest
45-
# push: true

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: debug-statements
9+
- id: double-quote-string-fixer
10+
- id: name-tests-test
11+
- id: check-json
12+
- id: check-merge-conflict
13+
- id: check-symlinks
14+
- id: detect-private-key
15+
- id: fix-byte-order-marker

README.md

Lines changed: 230 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,245 @@
1-
# IBMCloud CLI
1+
<div align="center">
22

3-
> A minimal container containing the CLI tools required for use in the IBMCloud
3+
> ⚠️ **Maintenance Notice**
4+
>
5+
> This repository is **no longer actively maintained**. Since its creation, IBM Cloud tools have evolved significantly, and I no longer use IBM Cloud in my daily work. The image may still work, but I won't be providing updates or support.
6+
>
7+
> Consider using [IBM Cloud Official Docker Images](https://github.com/IBM/ibmcloud-docker-image) or the [IBM Cloud CLI directly](https://github.com/IBM/ibmcloud-cli).
48
5-
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/47592904f94c4b70b1b9d5fa83249bb6)](https://www.codacy.com/gh/Oda2/docker-ibmcloud-cli/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Oda2/docker-ibmcloud-cli&amp;utm_campaign=Badge_Grade)
6-
![Main Branch](https://github.com/oda2/docker-ibmcloud-cli/actions/workflows/build.yml/badge.svg?branch=main)
7-
[![GitHub license](https://img.shields.io/github/license/Oda2/docker-ibmcloud-cli)](https://github.com/Oda2/docker-ibmcloud-cli/blob/main/LICENSE)
8-
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oda2/ibmcloud-cli/latest)](https://hub.docker.com/r/oda2/ibmcloud-cli)
9-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FOda2%2Fdocker-ibmcloud-cli.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FOda2%2Fdocker-ibmcloud-cli?ref=badge_shield)
9+
![IBMCloud CLI Docker](./assets/logo.png)
1010

11-
## Prerequisites
11+
# IBMCloud CLI Docker Image
1212

13-
- Docker
14-
- IBM API Key [IAM API Keys](https://cloud.ibm.com/iam/apikeys)
13+
### A minimalist Docker image with IBMCloud CLI ready for CI/CD and development
1514

16-
## Getting started
15+
[![Docker Pulls](https://img.shields.io/docker/pulls/oda2/ibmcloud-cli?color=blue&style=for-the-badge)](https://hub.docker.com/r/oda2/ibmcloud-cli)
16+
[![Docker Size](https://img.shields.io/docker/image-size/oda2/ibmcloud-cli/latest?color=blue&style=for-the-badge)](https://hub.docker.com/r/oda2/ibmcloud-cli)
17+
[![GitHub Stars](https://img.shields.io/github/stars/Oda2/docker-ibmcloud-cli?color=blue&style=for-the-badge)](https://github.com/Oda2/docker-ibmcloud-cli)
18+
[![License](https://img.shields.io/github/license/Oda2/docker-ibmcloud-cli?color=blue&style=for-the-badge)](LICENSE)
19+
[![Build](https://img.shields.io/github/actions/workflow/status/Oda2/docker-ibmcloud-cli/build.yml?branch=main&style=for-the-badge)](https://github.com/Oda2/docker-ibmcloud-cli/actions)
1720

18-
Launch the container as follows:
21+
---
1922

20-
```sh
23+
## ✨ Why Use This?
24+
25+
-**Zero installation** - Comes with IBMCloud CLI and all plugins pre-installed
26+
-**CI/CD ready** - Set environment variables and you're ready to go
27+
-**Small footprint** - Alpine-based image for minimal size
28+
-**Always up-to-date** - ~~Automatic builds with the latest version~~ (builds paused)
29+
30+
</div>
31+
32+
---
33+
34+
## 📋 Table of Contents
35+
36+
- [Quick Start](#quick-start)
37+
- [Environment Variables](#environment-variables)
38+
- [CI/CD Usage](#cicd-usage)
39+
- [Installed Plugins](#installed-plugins)
40+
- [Advanced Examples](#advanced-examples)
41+
- [Contributing](#contributing)
42+
- [License](#license)
43+
44+
---
45+
46+
## 🚀 Quick Start
47+
48+
### Basic Usage
49+
50+
```bash
2151
docker run -it \
22-
--name ibmcloud-cli \
23-
-e IBM_CLOUD_API_KEY=MY_API_KEY \
24-
-e IBM_CLOUD_REGION=MY_REGION \
25-
oda2/ibmcloud-cli sh
52+
-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY \
53+
-e IBM_CLOUD_REGION=us-south \
54+
oda2/ibmcloud-cli
55+
```
56+
57+
### With Docker Compose
58+
59+
```yaml
60+
services:
61+
ibmcloud:
62+
image: oda2/ibmcloud-cli
63+
environment:
64+
IBM_CLOUD_API_KEY: ${IBM_CLOUD_API_KEY}
65+
IBM_CLOUD_REGION: us-south
66+
volumes:
67+
- ./scripts:/scripts
68+
command: /bin/bash
69+
```
70+
71+
---
72+
73+
## 🔧 Environment Variables
74+
75+
| Variable | Required | Description | Default |
76+
|----------|----------|-------------|---------|
77+
| `IBM_CLOUD_API_KEY` | ✅ | Your IBM Cloud API Key | - |
78+
| `IBM_CLOUD_REGION` | ✅ | Region for login | `us-south` |
79+
| `IBM_CLOUD_RESOURCE_GROUP` | ❌ | Resource group | `default` |
80+
81+
> 🔐 **Tip**: Never expose your API Key in public repositories! Use CI/CD secrets.
82+
83+
---
84+
85+
## 🔄 CI/CD Usage
86+
87+
### GitHub Actions
88+
89+
```yaml
90+
jobs:
91+
deploy:
92+
runs-on: ubuntu-latest
93+
steps:
94+
- name: Login to IBM Cloud
95+
uses: oda2/docker-ibmcloud-cli@v1
96+
with:
97+
api-key: ${{ secrets.IBM_CLOUD_API_KEY }}
98+
region: us-south
99+
100+
- name: List clusters
101+
run: ibmcloud ks cluster ls
102+
```
103+
104+
### GitLab CI
105+
106+
```yaml
107+
deploy:
108+
image: oda2/ibmcloud-cli
109+
variables:
110+
IBM_CLOUD_API_KEY: $IBM_CLOUD_API_KEY
111+
IBM_CLOUD_REGION: us-south
112+
script:
113+
- ibmcloud ks cluster ls
114+
```
115+
116+
### Jenkins
117+
118+
```groovy
119+
pipeline {
120+
agent {
121+
docker {
122+
image 'oda2/ibmcloud-cli'
123+
args '-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY -e IBM_CLOUD_REGION=us-south'
124+
}
125+
}
126+
stages {
127+
stage('Deploy') {
128+
steps {
129+
sh 'ibmcloud ks cluster ls'
130+
}
131+
}
132+
}
133+
}
134+
```
135+
136+
### Azure DevOps
137+
138+
```yaml
139+
- task: Docker@2
140+
inputs:
141+
command: 'run'
142+
imageName: 'oda2/ibmcloud-cli'
143+
containerCommand: 'ibmcloud ks cluster ls'
144+
envVars: |
145+
IBM_CLOUD_API_KEY=$(IBM_CLOUD_API_KEY)
146+
IBM_CLOUD_REGION=us-south
147+
```
148+
149+
---
150+
151+
## 📦 Installed Plugins
152+
153+
| Plugin | Description |
154+
|--------|-------------|
155+
| `kubernetes-service` | Kubernetes cluster management (IKS) |
156+
| `container-registry` | Docker image management in IBM Cloud Container Registry |
157+
| `schematics` | Infrastructure as Code (IaC) with Terraform |
158+
| `cloud-object-storage` | Object Storage management |
159+
160+
### Checking Plugins
161+
162+
```bash
163+
$ ibmcloud plugin list
164+
165+
Listing installed plug-ins...
166+
167+
Plugin Name Version Status
168+
cloud-object-storage 1.3.1 Update Available
169+
container-registry 0.1.567 Update Available
170+
kubernetes-service 0.3.254 Update Available
171+
schematics 0.0.27 Update Available
172+
```
173+
174+
---
175+
176+
## 💡 Advanced Examples
177+
178+
### Running Specific Commands
179+
180+
```bash
181+
docker run --rm \
182+
-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY \
183+
-e IBM_CLOUD_REGION=us-south \
184+
oda2/ibmcloud-cli ibmcloud ks cluster ls
26185
```
27186

28-
## Plugins Installed default
187+
### Using with Kubernetes
188+
189+
```bash
190+
# Authenticate and get cluster credentials
191+
docker run --rm \
192+
-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY \
193+
-e IBM_CLOUD_REGION=us-south \
194+
oda2/ibmcloud-cli ibmcloud ks cluster config --cluster my-cluster
195+
196+
# Download kubeconfig
197+
docker run --rm \
198+
-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY \
199+
-e IBM_CLOUD_REGION=us-south \
200+
-v $(pwd):/output \
201+
oda2/ibmcloud-cli ibmcloud ks cluster config --cluster my-cluster --export > /output/kubeconfig
202+
```
203+
204+
### Build and Push Images
205+
206+
```bash
207+
docker run --rm \
208+
-e IBM_CLOUD_API_KEY=$IBM_CLOUD_API_KEY \
209+
-e IBM_CLOUD_REGION=us-south \
210+
-v /var/run/docker.sock:/var/run/docker.sock \
211+
-v $(pwd):/app \
212+
oda2/ibmcloud-cli sh -c "
213+
ibmcloud cr build -t registry.us-south.io/myapp:latest /app
214+
"
215+
```
216+
217+
---
218+
219+
## 🤝 Contributing
220+
221+
Contributions are welcome! See our [Contribution Guide](./.github/CONTRIBUTING.md).
222+
223+
1. Fork the project
224+
2. Create your branch (`git checkout -b feature/amazing-feature`)
225+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
226+
4. Push to the branch (`git push origin feature/amazing-feature`)
227+
5. Open a Pull Request
228+
229+
---
230+
231+
## 📄 License
232+
233+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
234+
235+
---
29236

30-
- kubernetes-service
31-
- container-registry
32-
- schematics
33-
- cloud-object-storage
237+
<div align="center">
34238

35-
## How is this useful
239+
### ⭐ Like it? Leave a star!
36240

37-
Instead of using the ibmcloud login installation in our CI, this container will always provide the ready-to-use CLI.
241+
[![GitHub Stars](https://img.shields.io/github/stars/Oda2/docker-ibmcloud-cli?style=social)](https://github.com/Oda2/docker-ibmcloud-cli)
38242

39-
### License
40-
Licensed under [MIT](https://github.com/Oda2/docker-ibmcloud-cli/blob/main/LICENSE)
243+
Made with ❤️ by [Renato Oda](https://github.com/Oda2)
41244

42-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FOda2%2Fdocker-ibmcloud-cli.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FOda2%2Fdocker-ibmcloud-cli?ref=badge_large)
245+
</div>

assets/logo.png

262 KB
Loading

0 commit comments

Comments
 (0)