## Quick Start Guide: Using ORAS CLI with Zot Registry to Distribute OCI Artifacts
### Prerequisites:
Before getting started, ensure that you have the following prerequisites:
👉 [**Docker**](https://docs.docker.com/engine/install/): an open-source platform for building, packaging, and running applications in isolated containers.
👉 [**ORAS CLI**](https://oras.land/docs/CLI/installation): a command-line tool for working with OCI artifacts.
👉 [**Zot Registry**](https://zotregistry.io/v1.4.3/install-guides/install-guide-linux/): a production-ready, open-source, vendor-neutral container image registry server based purely on OCI standards.
**Note**: It is recommended to install [zot-registry](https://zotregistry.io/v1.4.3/install-guides/install-guide-k8s/) through Kubernetes as it will be required for future purposes.
### Steps to Distribute OCI Artifacts:
**Step 1: Build an OCI Artifact**
To distribute an OCI artifact using **ORAS with Zot registry**, you need to have an OCI artifact, to begin with. For this guide, let's assume you have a directory containing the necessary files for your artifact. Make sure the artifact files are organized in the desired structure. If you don't have you can start by just creating a simple file also.
Create a sample file to push/pull as an artifact
```bash=
echo "hello world" > artifact.txt
```
**Step 2: Authenticate with Zot Registry**
Replace `zot-registry-url` with the URL of your Zot registry. This command prompts you for the necessary authentication credentials.
To authenticate with the Zot server, please login at the beginning of your session using the following command:
```bash=
echo $ZR_PASSWORD | oras login <registry-ip>:5000 -u $ZR_USER --password-stdin
```
**Step 3: Push the OCI Artifact to Zot Registry**
This will push an OCI artifact to the provided repository in your Zot registry with the latest tag, along with a configuration file and an additional file, to a registry using ORAS CLI.
To push the OCI artifact file named `hello-artifact` to the Zot registry, use the following command:
```bash=
oras push --plain-http <registry-ip>:5000/hello-artifact:v2 \
--config config.json:application/vnd.acme.rocket.config.v1+json \
artifact.txt:text/plain -d -v
```
**Step 4: Pull the OCI Artifact from Zot Registry**
This command is used to pull an OCI artifact using ORAS CLI, specifying the registry, artifact, and options for plain HTTP, debugging, and verbose output.
To pull the OCI artifact file named `hello-artifact` from the Zot registry, use the following command:
```bash=
oras pull --plain-http <registry-ip>:5000/hello-artifact:v2 -d -v
```
**Step 5: Verify the OCI Artifact**
You can verify the pulled OCI artifact to ensure it is intact and matches your expectations. Inspect the content and structure of the artifact in the specified output directory.
### Conclusion
Congratulations! You have successfully used the **ORAS CLI with the Zot registry** to distribute an OCI artifact. **Zot** is an OCI image registry that allows you to store, manage, and share container images, and ORAS enhances its capabilities by allowing the storage and retrieval of various types of artifacts.