cli: add config and images command

Extends the existing zot CLI to add commands for listing all images and
their details on a zot server.
Listing all images introduces the need for configurations.

Each configuration has a name and URL at the least. Check 'zot config
-h' for more details.

The user can specify the URL of zot server explicitly while running the
command or configure a URL and pass it directly.

Adding a configuration:
zot config add aci-zot <zot-url>

Run 'zot config --help' for more.

Listing all images:
zot images --url <zot-url>

Pass a config instead of the url:
zot images <config-name>

Filter the list of images by image name:
zot images <config-name> --name <image-name>

Run 'zot images --help' for all details

- Stores configurations in '$HOME/.zot' file

Add CLI README
This commit is contained in:
Tanmay Naik
2020-06-16 21:52:40 -04:00
parent 4a1519bb1d
commit ad684ac44b
17 changed files with 2169 additions and 84 deletions
+39
View File
@@ -7,6 +7,7 @@
* Uses [OCI storage layout](https://github.com/opencontainers/image-spec/blob/master/image-layout.md) for storage layout
* Supports [helm charts](https://helm.sh/docs/topics/registries/)
* Currently suitable for on-prem deployments (e.g. colocated with Kubernetes)
* [Command-line client support](#cli)
* TLS support
* Authentication via:
* TLS mutual authentication
@@ -97,6 +98,44 @@ podman run --rm -p 8080:8080 \
zot:latest
```
# CLI
The same zot binary can be used for interacting with any zot server instances.
## Adding a zot server URL
To add a zot server URL with an alias "remote-zot":
```console
$ zot config add remote-zot https://server-example:8080
```
List all configured URLs with their aliases:
```console
$ zot config -l
remote-zot https://server-example:8080
local http://localhost:8080
```
## Fetching images
You can fetch all images from a server by using its alias specified [in this step](#adding-a-zot-server-url):
```console
$ zot images remote-zot
IMAGE NAME TAG DIGEST SIZE
postgres 9.6.18-alpine ef27f3e1 14.4MB
postgres 9.5-alpine 264450a7 14.4MB
busybox latest 414aeb86 707.8KB
```
Or filter the list by an image name:
```console
$ zot images remote-zot -n busybox
IMAGE NAME TAG DIGEST SIZE
busybox latest 414aeb86 707.8KB
```
# Ecosystem
Since we couldn't find clients or client libraries that are stictly compliant to