1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Issue-#852: Add content and further references

This commit is contained in:
Akshay 2022-01-10 08:13:33 +01:00
parent 4654641afe
commit e999b4b723

View File

@ -3,14 +3,24 @@ title: Setting up private docker registry for Compute-to-Data environment
description: Learn how to setup your own docker registry and push images for running algorithms in a C2D environment.
---
The tutorial provides the steps to setup a private docker registry on the server. The document is intended for a production setup where anyone can pull the image from the registry but, only authenticated users will push images to the registry.
To implement this use case, 2 domains will be required:
- example.com: This domain will allow only image pull operations
- admin.example.com: This domain will allow image push/pull operations only to the authenticated users.
_Note: Please change the domain names to your application-specific domain names._
## Prerequisites
1. Running docker environment on the server.
2. Domain name is mapped to the server IP address.
2. 2 domain names is mapped to the same server IP address.
3. SSL certificate
## Generate certificates
```bash
# install certbot: https://certbot.eff.org/
sudo certbot certonly --standalone --cert-name example.com -d example.com
@ -127,18 +137,10 @@ http {
docker-compose -f docker-compose.yml up
```
## List images in the registry
## Login to registry
```bash
curl -X GET -u <username>:<password> https://example.com/v2/_catalog
```
## Other useful commands
### Login to registry
```bash
docker login example.com -u <username> -p <password>
docker login admin.example.com -u <username> -p <password>
```
### Build and push an image to the registry
@ -146,11 +148,30 @@ docker login example.com -u <username> -p <password>
Use the commands below to build an image from a `Dockerfile` and push it to your private registry.
```bash
docker build . -t example.com/my-algo:latest
docker build . -t admin.example.com/my-algo:latest
docker image push admin.example.com/my-algo:latest
```
docker image tag example.com/my-algo:latest
## List images in the registry
```bash
curl -X GET -u <username>:<password> https://example.com/v2/_catalog
```
## Pull an image from the registry
Use the commands below to build an image from a `Dockerfile` and push it to your private registry.
```bash
docker image pull example.com/my-algo:latest
```
## Next step
You can publish an algorithm asset with the metadata containing registry URL, image, and tag information to enable users to run C2D jobs.
## Further references
[Setup Compute-to-Data environment](/tutorials/compute-to-data-minikube/)
[Writing algorithms](/tutorials/compute-to-data-algorithms/)
[C2D example](/references/read-the-docs/ocean-py/READMEs/c2d-flow.md)