Commit Graph

19 Commits

Author SHA1 Message Date
Mish Ushakov 3d6418184f Add custom registries support for pulling base images (#897)
### Changelog

- added support for pulling base images from AWS, Docker, GCP
registries.
- removed unnecessary conversion in build_api.py.
- synced serialize implementation in TypeScript and Python.
- added Cursor Pylance config (side-effect, can delete if unwanted).

### Examples

**TypeScript**

```ts
import { Template } from 'e2b'

// Generic Docker registry
Template().fromRegistry('ubuntu:22.04', {
  username: 'jirka',
  password: 'password',
})

// AWS ECR registry
Template().fromAWSRegistry('ubuntu:22.04', {
  accessKeyId: '123',
  secretAccessKey: '456',
  region: 'eu-west-1',
})

// GCP GCR registry from file path
Template().fromGCPRegistry('ubuntu:22.04', {
  serviceAccountJSON: './service_account.json',
})

// GCP GCR registry from object
Template().fromGCPRegistry('ubuntu:22.04', {
  serviceAccountJSON: { project_id: '123', private_key_id: '456' },
})
```

**Python**

```py
from e2b import Template

# Generic Docker registry
Template().from_registry(
    image="ubuntu:22.04",
    username="jirka",
    password="password",
)

# AWS ECR registry
Template().from_aws_registry(
    image="ubuntu:22.04",
    access_key_id="123",
    secret_access_key="456",
    region="eu-west-1",
)

# GCP GCR registry from file path
Template().from_gcp_registry(
    image="ubuntu:22.04",
    service_account_json="./service_account.json",
)

# GCP GCR registry from object
Template().from_gcp_registry(
    image="ubuntu:22.04",
    service_account_json={"project_id": "123", "private_key_id": "456"},
)
```
2025-09-09 19:51:40 +00:00
Tomas Valenta e1aa4a1a28 Update vscode settings 2023-12-13 22:25:03 +01:00
Tomas Valenta 30887f6f78 Improve reconnect type when inheriting from sandbox; Cleanup 2023-12-11 11:30:05 +01:00
Vasek Mlejnsky 200775ec0f Update custom sandbox guide 2023-11-10 14:47:14 +01:00
Pavel 'Strajk' Dolecek f55da2d86c chore: npm → pnpm (#154) 2023-09-21 17:45:35 +02:00
Vasek Mlejnsky 2f2caa3045 New docs structure 2023-09-21 13:47:57 +02:00
Tomas Valenta 816cb14f79 Update vscode settings 2023-08-18 17:42:49 +02:00
Tomas Valenta 5ec71d979b Update vscode config 2023-08-18 02:22:19 +02:00
Tomas Valenta a8ad9af96c Fix rpc connection; Add deploy routes [WIP] 2023-05-04 01:06:40 +02:00
Tomas Valenta 1ec04cfdd2 Handle run via WS; Add run pausing and prompt edit [WIP] 2023-04-25 23:22:09 +00:00
Tomas Valenta 63f3e7fc51 Cleanup 2023-04-11 11:25:49 +00:00
Tomas Valenta 4fc4c858b4 Fix python linting and formatting setup 2023-04-11 11:20:19 +00:00
Tomas Valenta 03330b729c Update dev setup 2023-04-11 11:20:17 +00:00
Vasek Mlejnsky 81ce3974f3 Handle single-line actions 2023-03-20 21:14:43 +01:00
Tomas Valenta 0a119b7619 Add deploy to /generate [WIP] 2023-03-19 11:45:46 +00:00
Vasek Mlejnsky 7f7e744a04 commit 2023-03-13 11:41:40 +01:00
Tomas Valenta 0c8d19f30b Update VSCode settings for Python 2023-03-12 12:15:43 +00:00
Vasek Mlejnsky f7005f3bd4 enable cors in flask 2023-03-08 12:48:42 +01:00
Tomas Valenta 12a6130202 Setup project 2023-03-04 15:56:04 +00:00