curl --request POST \
--url https://api.zode.dev/v1/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"dockerfile": "<string>",
"setup": {
"run": [
"<string>"
],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"region": "eu-central",
"timeout_minutes": 30
}
'import requests
url = "https://api.zode.dev/v1/images"
payload = {
"name": "<string>",
"dockerfile": "<string>",
"setup": {
"run": ["<string>"],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"region": "eu-central",
"timeout_minutes": 30
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dockerfile: '<string>',
setup: {
run: ['<string>'],
env: {},
workdir: '<string>',
start: '<string>',
ready: '<string>'
},
region: 'eu-central',
timeout_minutes: 30
})
};
fetch('https://api.zode.dev/v1/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zode.dev/v1/images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'dockerfile' => '<string>',
'setup' => [
'run' => [
'<string>'
],
'env' => [
],
'workdir' => '<string>',
'start' => '<string>',
'ready' => '<string>'
],
'region' => 'eu-central',
'timeout_minutes' => 30
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zode.dev/v1/images"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zode.dev/v1/images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "building",
"error": "<string>",
"source_kind": "dockerfile",
"vcpus": 123,
"ram_mb": 123,
"disk_gb": 123,
"base": "<string>",
"region": "<string>",
"log_bytes": 123,
"created_by": {
"member_id": "<string>",
"email": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"dockerfile": "<string>",
"setup": {
"run": [
"<string>"
],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"warnings": [
"<string>"
]
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Build an image
Build a custom image (owner, admin, member).
Builds a golden image from a Dockerfile or from a base plus setup
commands. The node boots a build VM from the
base image of the asked size (the default size when none is given),
runs the steps with the workspace’s egress policy and no host access,
and freezes it with its memory. The build runs in the background:
202 returns the image building; follow GET /v1/images/{id}/logs.
Every sandbox made from the image has its size and region.
Plan limits (limits in GET /v1/images): 409 limit_reached.
400 invalid_image names the Dockerfile line that cannot be built.
Audited image.create.
curl --request POST \
--url https://api.zode.dev/v1/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"dockerfile": "<string>",
"setup": {
"run": [
"<string>"
],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"region": "eu-central",
"timeout_minutes": 30
}
'import requests
url = "https://api.zode.dev/v1/images"
payload = {
"name": "<string>",
"dockerfile": "<string>",
"setup": {
"run": ["<string>"],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"region": "eu-central",
"timeout_minutes": 30
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dockerfile: '<string>',
setup: {
run: ['<string>'],
env: {},
workdir: '<string>',
start: '<string>',
ready: '<string>'
},
region: 'eu-central',
timeout_minutes: 30
})
};
fetch('https://api.zode.dev/v1/images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zode.dev/v1/images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'dockerfile' => '<string>',
'setup' => [
'run' => [
'<string>'
],
'env' => [
],
'workdir' => '<string>',
'start' => '<string>',
'ready' => '<string>'
],
'region' => 'eu-central',
'timeout_minutes' => 30
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zode.dev/v1/images"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zode.dev/v1/images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"dockerfile\": \"<string>\",\n \"setup\": {\n \"run\": [\n \"<string>\"\n ],\n \"env\": {},\n \"workdir\": \"<string>\",\n \"start\": \"<string>\",\n \"ready\": \"<string>\"\n },\n \"region\": \"eu-central\",\n \"timeout_minutes\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "building",
"error": "<string>",
"source_kind": "dockerfile",
"vcpus": 123,
"ram_mb": 123,
"disk_gb": 123,
"base": "<string>",
"region": "<string>",
"log_bytes": 123,
"created_by": {
"member_id": "<string>",
"email": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"dockerfile": "<string>",
"setup": {
"run": [
"<string>"
],
"env": {},
"workdir": "<string>",
"start": "<string>",
"ready": "<string>"
},
"warnings": [
"<string>"
]
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Authorizations
An API key (zode_tok_...). Create one in the console under API keys (https://console.zode.dev/tokens), or with zode login.
Body
Exactly one of dockerfile and setup.
Response
Build started