Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add user documentation on how to use Zebra with docker #5504

Merged
merged 10 commits into from
Nov 1, 2022
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
- [Contents](#contents)
- [About](#about)
- [Using Zebra](#using-zebra)
- [Beta Releases](#beta-releases)
- [Running Zebra with Docker](#running-zebra-with-docker)
- [Release Candidates](#release-candidates)
- [Getting Started](#getting-started)
- [Build and Run Instructions](#build-and-run-instructions)
- [Build Instructions](#build-instructions)
- [Configuring JSON-RPC for lightwalletd](#configuring-json-rpc-for-lightwalletd)
- [Optional Features](#optional-features)
- [System Requirements](#system-requirements)
Expand Down Expand Up @@ -51,10 +52,19 @@ You would want to run Zebra if you want to contribute to the
Zcash network: the more nodes are run, the more reliable the network will be
in terms of speed and resistance to denial of service attacks, for example.

Zebra aims to be
[faster, more secure, and more easily extensible](https://doc.zebra.zfnd.org/zebrad/index.html#zebra-advantages)
Zebra aims to be [faster, more secure, and more easily extensible](https://doc.zebra.zfnd.org/zebrad/index.html#zebra-advantages)
than other Zcash implementations.

### Running Zebra with Docker

You can easily run Zebra using Docker with a simple command

```shell
docker run -d zfnd/zebra:1.0.0-rc.0
```

For more information, read our [Docker documentation](book/src/user/docker.md).
gustavovalverde marked this conversation as resolved.
Show resolved Hide resolved

## Release Candidates

Every few weeks, we release a [new Zebra version](https://github.com/ZcashFoundation/zebra/releases).
Expand Down
38 changes: 38 additions & 0 deletions book/src/user/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Zebra with Docker

We've embraced Docker in Zebra for most of the solution lifecycle, from development environments to CI (in our pipelines), and deployment to end users. Zebra can be built from source using Cargo, Rust’s build system and package manager alternatively, you can easily deploy Zebra using [Docker](https://docs.docker.com/get-docker/)
gustavovalverde marked this conversation as resolved.
Show resolved Hide resolved

## Quick usage

You can deploy Zebra for a daily use with the images available in [Docker Hub](https://hub.docker.com/repository/docker/zfnd/zebra) or build it locally for testing

### Ready to use image

```shell
docker run -d zfnd/zebra:1.0.0-rc.0
teor2345 marked this conversation as resolved.
Show resolved Hide resolved
```
gustavovalverde marked this conversation as resolved.
Show resolved Hide resolved

### Build it locally

```shell
git clone --depth 1 --branch v1.0.0-rc.0 [email protected]:ZcashFoundation/zebra.git
docker build -f docker/Dockerfile --target runtime -t zebra:local
docker run -d zebra:local
teor2345 marked this conversation as resolved.
Show resolved Hide resolved
```

## Images

The Zebra team builds multiple images with a single [Dockerfile](https://github.com/ZcashFoundation/zebra/blob/main/docker/Dockerfile) using [multistage builds](https://docs.docker.com/build/building/multi-stage/). The `test` stage adds needed features and tools (like [lightwalletd](https://github.com/adityapk00/lightwalletd)) and the `runtime` stage just adds the *zebrad* binary and required *zcash-params* for Zebra to run correctly.

As a result the Zebra team builds four images:

- [zcash-params](us-docker.pkg.dev/zealous-zebra/zebra/zcash-params): built Zcash network parameters
- [lightwalletd](us-docker.pkg.dev/zealous-zebra/zebra/lightwalletd): a backend service that provides an interface to the Zcash blockchain
- [zebrad-test](us-docker.pkg.dev/zealous-zebra/zebra/zebrad-test): a zebrad binary with lightwalletd included, and test suites enabled
- [zebra](https://hub.docker.com/repository/docker/zfnd/zebra): a streamlined version with the zebrad binary and just the needed features needed to run *as-is*

## Registries

The images built by the Zebra team are all publicly hosted. Old image versions meant to be used by our [CI pipeline](https://github.com/ZcashFoundation/zebra/blob/main/.github/workflows/continous-integration-docker.yml) (`zebrad-test`, `lighwalletd`) might be deleted on a scheduled basis.

We use [Docker Hub](https://hub.docker.com/repository/docker/zfnd/zebra) for end-user images and [Google Artifact Registry](https://console.cloud.google.com/artifacts/docker/zealous-zebra/us/zebra) to build external tools and test images