Vasek Mlejnsky cd4880eeae Explicitly mention Docker commands when building template (#586)
This PR improves CLI messaging when building sandbox templates. Now, the
used Docker commands are explicitly logged to the user like this:

```
Building docker image with the following command:
docker build . \ # <--- This log is new
   -f e2b.Dockerfile \
   --pull --platform linux/amd64 \
   -t docker.e2b.dev/e2b/custom-envs/vqwjjtzwfi59d1cwww1k:ec8a819a-9666-45df-997b-e181b9fe4224 

[+] Building 0.7s (5/5) FINISHED                                                                              docker:desktop-linux
 => [internal] load build definition from e2b.Dockerfile                                                                      0.0s
 => => transferring dockerfile: 149B                                                                                          0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04 
```
and
```
Pushing docker image with the following command:
docker push docker.e2b.dev/e2b/custom-envs/vqwjjtzwfi59d1cwww1k:ec8a819a-9666-45df-997b-e181b9fe4224 # <--- This log is new

The push refers to repository [docker.e2b.dev/e2b/custom-envs/vqwjjtzwfi59d1cwww1k]
```

so the user can potentially debug some issues on their own.
2025-02-21 15:02:38 -08:00
2025-02-21 15:01:56 -08:00
2024-10-15 11:52:54 -07:00
2023-12-09 19:38:16 +01:00
2023-09-26 19:12:23 +02:00
2024-07-15 14:44:16 +02:00
2025-01-23 21:17:08 -08:00
2025-01-17 14:28:42 -08:00
2024-10-15 08:29:46 -07:00
2024-10-15 10:39:10 -07:00
2024-10-15 11:52:54 -07:00
2024-11-26 10:34:04 -08:00
2023-07-01 17:08:01 -07:00
2024-12-05 18:00:45 -08:00
2024-12-05 18:00:45 -08:00
2023-05-21 10:51:33 -07:00
2024-11-28 10:47:30 -08:00
2025-02-05 10:48:55 -08:00
2025-01-13 11:14:03 -08:00

e2b logo

Last 1 month downloads for the Python SDK Last 1 month downloads for the JavaScript SDK

What is E2B?

E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.

Note

This repository contains the core E2B SDK that's used in our main E2B Code Interpreter SDK.

Run your first Sandbox

1. Install SDK

JavaScript / TypeScript

npm i @e2b/code-interpreter

Python

pip install e2b-code-interpreter

2. Get your E2B API key

  1. Sign up to E2B here.
  2. Get your API key here.
  3. Set environment variable with your API key
E2B_API_KEY=e2b_***

3. Execute code with code interpreter inside Sandbox

JavaScript / TypeScript

import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create()
await sandbox.runCode('x = 1')

const execution = await sandbox.runCode('x+=1; x')
console.log(execution.text)  // outputs 2

Python

from e2b_code_interpreter import Sandbox

with Sandbox() as sandbox:
    sandbox.run_code("x = 1")
    execution = sandbox.run_code("x+=1; x")
    print(execution.text)  # outputs 2

4. Check docs

Visit E2B documentation.

5. E2B cookbook

Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.

S
Description
E2B 是开源的安全运行时环境,为企业级 AI Agent 提供真实工具支持。|GitHub 镜像 13.6k · 🍴 1k
https://github.com/e2b-dev/e2b Readme Apache-2.0 129 MiB
Languages
Python 57.1%
TypeScript 42.2%
Dockerfile 0.3%
JavaScript 0.1%
Makefile 0.1%
Other 0.1%