> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/docker/docker-images-in-cortex-xsoar/create-a-docker-image-in-cortex-xsoar.md).

# Create a Docker Image In Cortex XSOAR

After due diligence has been completed and licenses checked, the following steps can be taken.

{% hint style="info" %}

### Note

When using a custom Docker registry, including the Cortex XSOAR Container Registry, you must include **`localhost`** when you create a custom Docker image. Examples:

* **`localhost.local/directory/container_name`**
* **`localhost/directory/container_name`**

Before creating a new Docker image, we recommend you review the [used\_packages.csv](https://github.com/demisto/dockerfiles-info/blob/master/used_packages.csv) file in the GitHub dockerfiles repository to determine if any existing Docker images already contain the Python modules you need. Find **Requests** in the **Package Name** column and scroll to the right to view the list of Docker images, and then search for the relevant Docker container name to view which modules are included in that image. Determine if the existing image is appropriate for your needs. If so, use the existing Docker image. If not, proceed with the following steps to create a new custom Docker image.
{% endhint %}

1. In the War Room, type the following command:

   **`/docker_image_create name`**
2. Add the following arguments:

   | Argument           | Description                                                                                                                                            |
   | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
   | **`name`**         | New Docker image name. Lower case only                                                                                                                 |
   | **`dependencies`** | New Docker image dependencies. Python libs like stix or requests; can have multiple comma-separated libs: **`lib1,lib2,lib3`**.                        |
   | **`packages`**     | New Docker image packages. OS packages like libxslt or wget; can have multiple comma-separated packages: **`pkg1,pkg2,pkg3`**.                         |
   | **`base`**         | New Docker image base image to use. It must be Ubuntu-based with Python installed. The default is the demisto/python3-deb base image, with Python 3.x. |

   In the following example, create a Docker image called **`example_name`** and use the Python dependency, **`Mechanize`**. You can specify OS packages. This example requires wget as a package.

   **`/docker_image_create name=example_name dependencies=mechanize packages=wget`**

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>For Python modules, dependencies are not automatically added. If a Python module has dependencies, you need to specify them.</p><p>Example of a request including the idna and chardet dependencies:</p><p><strong><code>/docker_image_create name=custom/requests dependencies=idna,chardet,requests base="demisto/python3-deb:3.10.12.63475</code></strong></p></div>

   When the Docker image is created, the following dialog box appears.

   ![docker-image.png](/files/mbtDDy7NoHVyqghHb0x2)

   The Docker image is ready to use.
3. (Optional) If you need to update a Docker image, type the following command:

   **`/docker_image_update`**
4. Add the following arguments:

   | Argument    | Description            |
   | ----------- | ---------------------- |
   | **`image`** | The name of the image. |
   | **`all`**   | Pulls all images.      |
5. (Optional) To see all available images, type the following:

   **`/docker_images`**

   This command does not accept any arguments and lists all available Docker images.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/docker/docker-images-in-cortex-xsoar/create-a-docker-image-in-cortex-xsoar.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
