Getting Started

Run exposes a push-oriented Docker Registry v2 subset and a Console API for repository state, starts, stops, rollbacks, environment variables, and volumes.

Authentication

Registry endpoints use Docker Basic Auth credentials configured by docker login.

1docker login run.hola.cloud

Building and Pushing an Image

Create a simple application with a Dockerfile:

1FROM alpine:latest
2COPY app.sh /app.sh
3RUN chmod +x /app.sh
4CMD ["/app.sh"]

Build and tag the image:

1docker build -t run.hola.cloud/my-project/my-app:v1 .

Push to Run:

1docker push run.hola.cloud/my-project/my-app:v1

Reading Console Data

Query the current Console data for a repository:

1curl "https://api.hola.cloud/api/console?repository=my-project/my-app"

Starting a Repository

Start a repository from a pushed tag or digest:

1curl -X POST "https://api.hola.cloud/api/console/start" \
2  -H "Content-Type: application/json" \
3  -d '{
4    "repository": "my-project/my-app",
5    "reference": "v1"
6  }'

You can also use a digest:

1{
2  "repository": "my-project/my-app",
3  "digest": "sha256:a1b2c3d4..."
4}

Stopping a Repository

1curl -X POST "https://api.hola.cloud/api/console/stop" \
2  -H "Content-Type: application/json" \
3  -d '{"repository": "my-project/my-app"}'

Rolling Back

Rollback uses the same repository plus reference or digest shape:

1curl -X POST "https://api.hola.cloud/api/console/rollback" \
2  -H "Content-Type: application/json" \
3  -d '{
4    "repository": "my-project/my-app",
5    "reference": "v0"
6  }'

Managing Environment Variables

1curl -X PUT "https://api.hola.cloud/api/console/env" \
2  -H "Content-Type: application/json" \
3  -d '{
4    "repository": "my-project/my-app",
5    "env": [
6      {"key": "LOG_LEVEL", "desired_value": "debug"},
7      {"key": "DATABASE_URL", "desired_value": "postgres://..."}
8    ]
9  }'

Managing Volumes

1curl -X PUT "https://api.hola.cloud/api/console/volumes" \
2  -H "Content-Type: application/json" \
3  -d '{
4    "repository": "my-project/my-app",
5    "volumes": [
6      {"name": "my-data", "target": "/data", "mode": "rw"}
7    ]
8  }'

Complete Workflow Example

1docker login run.hola.cloud
2docker build -t run.hola.cloud/my-project/my-app:v1 .
3docker push run.hola.cloud/my-project/my-app:v1
4curl -X POST "https://api.hola.cloud/api/console/start" \
5  -H "Content-Type: application/json" \
6  -d '{"repository": "my-project/my-app", "reference": "v1"}'
7curl "https://api.hola.cloud/api/console?repository=my-project/my-app"

Comments

Leave a comment