Upload local files for a Dockerfile build
Uploads the directory that a Dockerfile’s COPY and ADD lines read from. The
body is a gzipped tar of that directory, sent with
Content-Type: application/gzip. Pass the returned id as build_context_id
on POST /v1/images. Meadow hands the same files to every vendor that builds
the image.
Limits:
- 100 MB compressed (104,857,600 bytes). A larger body returns 413.
- 512 MiB and 10,000 entries after unpacking.
- Regular files and directories only. Links and device files return 400.
- Paths must be relative and stay inside the archive root.
- The upload must finish within 10 minutes.
Larger inputs, such as datasets and model weights, belong in a base image or should be downloaded during the build.
Uploading the same bytes again returns the same id and moves expires_at
forward. A context expires 24 hours after its last use. There is no call to
delete one, and a project cannot be deleted until its build contexts have
expired.
A failure to store a valid archive returns 500. The upload can be retried.
Scope: sandboxes.
The archive can come from a file or straight from a pipe. Some tar builds,
the one on macOS among them, pad what they write to a pipe with zero bytes
after the gzip stream. Meadow accepts that padding. Any other data after the
gzip stream, a wrong checksum, or a stream that is cut short returns 400.
Authentication
A Meadow API key, sent as Authorization: Bearer mdw_.... The header
x-api-key: mdw_... is accepted in its place.
Request
Response headers
Meadow’s id for this request, req_ and 24 hex characters. Every response
carries it, including errors, streams and unknown routes. Every error in the
Error schema repeats it as request_id. Quote it when you report a problem.
Response
Pass as build_context_id on POST /v1/images.