Check Dockerfile
curl --request POST \
--url https://api.vertracloud.app/v1/images/check \
--header 'Content-Type: application/json' \
--data '
{
"dockerfile": "<string>",
"files": [
"<string>"
]
}
'import requests
url = "https://api.vertracloud.app/v1/images/check"
payload = {
"dockerfile": "<string>",
"files": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({dockerfile: '<string>', files: ['<string>']})
};
fetch('https://api.vertracloud.app/v1/images/check', 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.vertracloud.app/v1/images/check",
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([
'dockerfile' => '<string>',
'files' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.vertracloud.app/v1/images/check"
payload := strings.NewReader("{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.vertracloud.app/v1/images/check")
.header("Content-Type", "application/json")
.body("{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": {
"refusals": [{ "code": "run_network_host", "line": 7 }],
"warnings": [{ "code": "workdir_app", "line": 3 }],
"suggested_port": 3000
}
}
Docker Images
Check Dockerfile
Checks a Dockerfile and the file list of a build context before building. Creates nothing.
POST
/
v1
/
images
/
check
Check Dockerfile
curl --request POST \
--url https://api.vertracloud.app/v1/images/check \
--header 'Content-Type: application/json' \
--data '
{
"dockerfile": "<string>",
"files": [
"<string>"
]
}
'import requests
url = "https://api.vertracloud.app/v1/images/check"
payload = {
"dockerfile": "<string>",
"files": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({dockerfile: '<string>', files: ['<string>']})
};
fetch('https://api.vertracloud.app/v1/images/check', 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.vertracloud.app/v1/images/check",
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([
'dockerfile' => '<string>',
'files' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.vertracloud.app/v1/images/check"
payload := strings.NewReader("{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.vertracloud.app/v1/images/check")
.header("Content-Type", "application/json")
.body("{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dockerfile\": \"<string>\",\n \"files\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": {
"refusals": [{ "code": "run_network_host", "line": 7 }],
"warnings": [{ "code": "workdir_app", "line": 3 }],
"suggested_port": 3000
}
}
The same check runs again when you create or rebuild an image, so a clean result here never replaces it. A check does not count against any limit. Needs the
images:read scope when called with an API key.
string
required
The content of the
Dockerfile.string[]
required
The paths of the files in the build context, relative to its root.
Response
object
Finding codes
| Code | Kind | Meaning |
|---|---|---|
missing_dockerfile | Refusal | There is no file named exactly Dockerfile at the root of the context. |
syntax_frontend | Refusal | A # syntax= directive points to something other than the official Dockerfile frontend. |
run_security_insecure | Refusal | RUN --security=insecure. |
run_network_host | Refusal | RUN --network=host. |
mount_ssh | Refusal | --mount=type=ssh. |
mount_secret | Refusal | --mount=type=secret. |
workdir_app | Warning | WORKDIR at /app or below. /app is the app’s persistent disk, so what the image puts there is hidden by the mount. |
env_file_in_context | Warning | .env* files in the context. They are removed before the build; their keys become app variables. |
copy_env_file | Warning | COPY or ADD of a .env file. The file is not in the build context, so the build fails on that line. |
volume_outside_app | Warning | VOLUME outside /app. At runtime that path is a temporary 64 MB folder, erased on every restart; only /app keeps data. |
volume_refused | Refusal | VOLUME at /app or below, or with a relative path. /app is already the app’s persistent disk. |
{
"response": {
"refusals": [{ "code": "run_network_host", "line": 7 }],
"warnings": [{ "code": "workdir_app", "line": 3 }],
"suggested_port": 3000
}
}
Error Responses
string
The error code indicating the reason for the failure. Possible values:
API_KEY_SCOPE_DENIED: The API key does not have the required scope (403).VALIDATION_ERROR: The body failed validation (400).INTERNAL_SERVER_ERROR: Unexpected failure (500).
{
"code": "VALIDATION_ERROR",
"path": "dockerfile"
}