---
id: build-image
title: "Build Image"
description: "Builds a Docker image from a tar file containing the application code."
sidebar_label: "Build Image"
hide_title: true
hide_table_of_contents: true
api: eJztVktvGzcQ/isETw6gSI7Rk06V7RYx+rBhK+1BFgR6l5IYccktOZtUEfa/d4bkanctS80DORSoL9ZyZr6Zb17kjoNYeT6e8StrQCgjnefzAc+lz5wqQVnDx/yyUjr3TLBrm22kY6oQK8mWzhZ4BsKxpdKSZRFBmRWDtWSiLLXKBEGgKJfDR/NoJm7lx4+G4R/KFypnZx7cqzGbosXNNbPLA1uw7In8B0HybN0wgjwJLxdGFLKLQ4csHCa4aNUAJVOMexHiPntXaivyn/F3AvgCSoTkwW6kWXjpPUnOHuKPfUYTaiPPmnPiEXArjx+F2DR+nPyrkh5Cxu4lVM40SbshJhGuVwtYC2AfhQ8MYcgH3JbShUhvcqxgIL4IuigrhcPsANV6PNtxShXqxIKgWFHNMQK3xQ+KRTmJIOAqOeA+W8tC8PGOw7YkM8w7xo2aoEDTwaQsGTqt68Eeel+mb0e/pOL+TlB1PY8AmKpLm2/J6jke5VoaIFFRaVDIHEaY9uJ1LiD4aT2WjnIGSvrgP7XHS7EQgADipYwIPJroptg51EjEvjGzT+9lBj2ysxZ+3qGGJBbdStU1wTjpS2t8DOvi/Jz+9efzocoybK5lpdl9UuY97p3GHb33ZHOCeIgabcz2dhn6o0+fyppOTKU1rzsMpnSOIeehN6mbTlQyNTC1yiCtoePKU5KjnnUrYdSnQCXhf02gtx2YFMFH6za+FJn8Btg/G4w0AKdbgGTdXKUsdPDCuC9SH/xwcXFY+j+EVnmk8ZNz1n193XOJW0nTLwWy8IcK2mY96WckSGEkK+kwR20uhHOiOzK/2hgg1aDwq1NN8Bs2eZiLwb5Lj6mGZLDYj/9SB+IVXSe9TgHa9MbsHqdxHdP3krNG5e10encAGGuL23htaVGX1kPY0LDGr9H+rvCj/grHG+NDs78rh2Xja4DSj0ejTNsqH6IWWg6FGolS8ecX+iRI2RWphgb2Mqucgm3Am9zd/CK3b6XIsXTj2byr8EDdE/uhr7YvBfrDY3SZdv+kQmouzVqz/9fRiqgrs7TBvLk+YmyXAsfC0FAQzxj2+fDN8PwYmWTAMKw0BCILQ9DEEdRQ1E/XPlEowbmgCeAgRfFjK6AoqS6FMB288CiKF/LzkHbtDP7/dvoPvp1SJ4P8G0alRn8096FtdmkyZ7ydTDToziYOy5qGGHV2O0rnO6frmo7jo4cmLFdePGlaP0uhvTzRPmf3aVO9YscC2+C0dV5vH4SuSCns4e/gqPuWa33N6cMpchZWxqAZcaIbDa+ir9fTeO81ti+9yyj0aDTBl00JHfWDK41c79fn3e3DlOqRnoMFNhqeEnDAHbQ/Kci6/gcCvHQd
sidebar_class_name: "post api-method"
info_path: reference/api/agenta-backend
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Markdown from "@theme/Markdown";
import Heading from "@theme/Heading";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Build Image"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/containers/build_image"}
>
  
</MethodEndpoint>



Builds a Docker image from a tar file containing the application code.

Args:
    app_id (str): The ID of the application to build the image for.
    base_name (str): The base name of the image to build.
    tar_file (UploadFile): The tar file containing the application code.
    stoken_session (SessionContainer): The session container for the user making the request.

Returns:
    Image: The Docker image that was built.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<details
  style={{"marginBottom":"1rem"}}
  className={"openapi-markdown__details"}
  data-collapsed={false}
  open={true}
>
  <summary
    style={{}}
  >
    <h3
      className={"openapi-markdown__details-summary-header-params"}
    >
      Query Parameters
    </h3>
  </summary><div>
    <ul>
      <ParamsItem
        className={"paramsItem"}
        param={{"name":"app_id","in":"query","required":true,"schema":{"type":"string","title":"App Id"}}}
      >
        
      </ParamsItem><ParamsItem
        className={"paramsItem"}
        param={{"name":"base_name","in":"query","required":true,"schema":{"type":"string","title":"Base Name"}}}
      >
        
      </ParamsItem>
    </ul>
  </div>
</details><MimeTabs
  className={"openapi-tabs__mime"}
>
  <TabItem
    label={"multipart/form-data"}
    value={"multipart/form-data-schema"}
  >
    <details
      style={{}}
      className={"openapi-markdown__details mime"}
      data-collapsed={false}
      open={true}
    >
      <summary
        style={{}}
        className={"openapi-markdown__details-summary-mime"}
      >
        <h3
          className={"openapi-markdown__details-summary-header-body"}
        >
          Body
        </h3><strong
          className={"openapi-schema__required"}
        >
          required
        </strong>
      </summary><div
        style={{"textAlign":"left","marginLeft":"1rem"}}
      >
        
      </div><ul
        style={{"marginLeft":"1rem"}}
      >
        <SchemaItem
          collapsible={false}
          name={"tar_file"}
          required={true}
          schemaName={"binary"}
          qualifierMessage={undefined}
          schema={{"type":"string","format":"binary","title":"Tar File"}}
        >
          
        </SchemaItem>
      </ul>
    </details>
  </TabItem>
</MimeTabs><div>
  <div>
    <ApiTabs
      label={undefined}
      id={undefined}
    >
      <TabItem
        label={"200"}
        value={"200"}
      >
        <div>
          
          
          Successful Response
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              type
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span><strong
                              style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}
                            >
                               required
                            </strong>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <div
                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                >
                                  
                                  
                                  string
                                  
                                  
                                </div>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"docker_id"}
                        required={true}
                        schemaName={"Docker Id (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Docker Id"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={false}
                        name={"tags"}
                        required={true}
                        schemaName={"Tags (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Tags"}}
                      >
                        
                      </SchemaItem><SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              organization_id
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <div
                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                >
                                  
                                  
                                  string
                                  
                                  
                                </div>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem><SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <strong>
                              workspace_id
                            </strong><span
                              style={{"opacity":"0.6"}}
                            >
                               object
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            
                          </div><div>
                            <span
                              className={"badge badge--info"}
                            >
                              anyOf
                            </span><SchemaTabs>
                              <TabItem
                                label={"MOD1"}
                                value={"0-item-properties"}
                              >
                                <div
                                  style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                >
                                  
                                  
                                  string
                                  
                                  
                                </div>
                              </TabItem>
                            </SchemaTabs>
                          </div>
                        </details>
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"type\": \"string\",\n  \"docker_id\": \"string\",\n  \"tags\": \"string\",\n  \"organization_id\": \"string\",\n  \"workspace_id\": \"string\"\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem><TabItem
        label={"422"}
        value={"422"}
      >
        <div>
          
          
          Validation Error
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <span
                              className={"openapi-schema__container"}
                            >
                              <strong
                                className={"openapi-schema__property"}
                              >
                                detail
                              </strong><span
                                className={"openapi-schema__name"}
                              >
                                 object[]
                              </span>
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            <li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                              >
                                Array [
                              </div>
                            </li><SchemaItem
                              collapsible={true}
                              className={"schemaItem"}
                            >
                              <details
                                style={{}}
                                className={"openapi-markdown__details"}
                              >
                                <summary
                                  style={{}}
                                >
                                  <span
                                    className={"openapi-schema__container"}
                                  >
                                    <strong
                                      className={"openapi-schema__property"}
                                    >
                                      loc
                                    </strong><span
                                      className={"openapi-schema__name"}
                                    >
                                       object[]
                                    </span><span
                                      className={"openapi-schema__divider"}
                                    >
                                      
                                    </span><span
                                      className={"openapi-schema__required"}
                                    >
                                      required
                                    </span>
                                  </span>
                                </summary><div
                                  style={{"marginLeft":"1rem"}}
                                >
                                  <li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                    >
                                      Array [
                                    </div>
                                  </li><div>
                                    <span
                                      className={"badge badge--info"}
                                    >
                                      anyOf
                                    </span><SchemaTabs>
                                      <TabItem
                                        label={"MOD1"}
                                        value={"0-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          string
                                          
                                          
                                        </div>
                                      </TabItem><TabItem
                                        label={"MOD2"}
                                        value={"1-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          integer
                                          
                                          
                                        </div>
                                      </TabItem>
                                    </SchemaTabs>
                                  </div><li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                    >
                                      ]
                                    </div>
                                  </li>
                                </div>
                              </details>
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"msg"}
                              required={true}
                              schemaName={"Message (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Message"}}
                            >
                              
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"type"}
                              required={true}
                              schemaName={"Error Type (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Error Type"}}
                            >
                              
                            </SchemaItem><li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                              >
                                ]
                              </div>
                            </li>
                          </div>
                        </details>
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"detail\": [\n    {\n      \"loc\": [\n        \"string\",\n        0\n      ],\n      \"msg\": \"string\",\n      \"type\": \"string\"\n    }\n  ]\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem>
    </ApiTabs>
  </div>
</div>
      