feat(sdk): start sandbox from Dockerfile via Image.from_dockerfile#1043
Open
Issac-Newton wants to merge 2 commits into
Open
feat(sdk): start sandbox from Dockerfile via Image.from_dockerfile#1043Issac-Newton wants to merge 2 commits into
Issac-Newton wants to merge 2 commits into
Conversation
3 tasks
Issac-Newton
force-pushed
the
feature/start-from-dockerfile
branch
8 times, most recently
from
June 3, 2026 06:55
e7515e1 to
a80b39b
Compare
StephenRi
reviewed
Jun 3, 2026
| def from_dockerfile( | ||
| path: str | Path, | ||
| *, | ||
| registry: ImageRegistry | None = None, |
Collaborator
There was a problem hiding this comment.
registry,builder_config如果不填,默认值怎么获取
StephenRi
reviewed
Jun 3, 2026
| ) | ||
| return status == 200 | ||
|
|
||
| async def build_with_builder(self, spec: BuildSpec, builder: Sandbox) -> str: |
StephenRi
reviewed
Jun 3, 2026
| self._builder_config = builder_config | ||
| self._builder = builder | ||
|
|
||
| def create_builder(self) -> Sandbox: |
Issac-Newton
force-pushed
the
feature/start-from-dockerfile
branch
5 times, most recently
from
June 12, 2026 12:09
343623a to
a82bb59
Compare
Add AcrConfig (registry + builder_image) dataclasses, GET /acr_config API returning temporary ACR credentials via GetAuthorizationToken, and aliyun-python-sdk-cr as an explicit admin dependency. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add Image.from_dockerfile() API for building sandbox images from local Dockerfiles, with ImageBuilder, ImageRegistry, and BuilderConfig models. Includes user guide docs (en + zh-Hans) and SDK-side /acr_config integration. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Issac-Newton
force-pushed
the
feature/start-from-dockerfile
branch
from
June 12, 2026 12:13
a82bb59 to
ca74efd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #531
Summary
Image.from_dockerfile(path)lets users declare a sandbox image from a localDockerfile or build context.
Sandbox.start()transparently builds + pushesinside a DinD builder sandbox and starts the user sandbox from the resulting
tag — no manual
docker build/docker pushneeded.Design
{registry_url}/{namespace}/{repository}:{content_hash},where
content_hashis the full SHA-256 of the build context (OCI digest length).Content changes → new tag → deterministic cache.
with internal/VPC registries):
HTTP HEAD— fast path, skips builder on hit.docker manifest inspectinside builder — catches hits L1 misseddue to network reachability.
pathaccepts both a directory (build context, must containDockerfile)and a single Dockerfile file (only that file is the context).
rock-env-builderships withdaemon.jsonthat puts dockerddata-rooton the XFS volume ROCK alreadybind-mounts at
/data/logs, disablescontainerd-snapshotterso BuildKitsidesteps overlay-on-overlay, and is built clean of stale pidfiles. SDK is
unaware.
Imageresolves to a string at the SDK boundarybefore the HTTP call.
Docs
zh-Hans
Test plan
pytest tests/unit/sdk/sandbox/test_image.pypytest tests/integration/sdk/sandbox/test_image_build.py -m need_adminvpc-zb-awith the actual rock-env-builder imageCo-Authored-By: Claude Opus 4.7 [email protected]