> For the complete documentation index, see [llms.txt](https://docs.xygeni.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xygeni.io/xygeni-scanner-cli/xygeni-cli-overview/xygeni-cli-docker-image.md).

# Xygeni CLI Docker Image

The `xygeni/xygeni_scanner` **docker image** is convenient if you plan to run the scanner without installing the required tools. You can run a Docker container using the image that includes all the tools needed to run the scanner in a standard developer environment.

### Quickstart <a href="#quickstart" id="quickstart"></a>

{% hint style="info" %}
Usage requires to provide an active Xygeni account or API token to the scanner.
{% endhint %}

Save the following code as `docker-compose.yml`:

```yaml
services:
  xygeni_scanner:
    image: xygeni/xygeni_scanner:latest
    container_name: xygeni
    command: scan -n $PROJECT_NAME --dir /app
    environment:
      - PROJECT_NAME=${PROJECT_NAME}
      - XYGENI_TOKEN=${XYGENI_TOKEN}
    volumes:
      - "${PATH_TO_SCAN}:/app"
    tty: true
```

By using this `docker-compose.yml` you will be able to quickly perform a scan as it simplifies the usage by providing a scheme for the volumes that the scanner requires to be mounted.

To customize volume paths or the project name for this quickstart you can edit the docker compose file or, as a better practice, use the following `.env` file scheme:

```linenums
PATH_TO_SCAN=...
PROJECT_NAME=...
```

Now let’s run your first scan:

```bash
docker compose up
```

{% hint style="info" %}
By default, a full scan is performed. Surely you may want to customize this behaviour. To achieve that, you should run the container with your desired command.
{% endhint %}

```bash
docker compose run xygeni_scanner secrets -n project_to_scan_name --dir /app
```

### Advanced usage <a href="#advanced_usage" id="advanced_usage"></a>

First you need to manually pull the Docker image from the xygeni docker hub repository.

```bash
docker pull xygeni/xygeni_scanner:latest
```

Usually you will mount a volume for the project to scan when running this Docker container:

```bash
docker run \
  -it \
  -v "${PATH_TO_SCAN}:/app" \
  -e XYGENI_TOKEN=${XYGENI_TOKEN} \
  -t xygeni/xygeni_scanner scan -n test --dir /app
```

### CLI Options

Please refer to the [Xygeni CLI mode of operation](/xygeni-scanner-cli/xygeni-cli-overview/xygeni-cli-operation-modes.md) for full details on the scanner command line options and configuration.


---

# 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://docs.xygeni.io/xygeni-scanner-cli/xygeni-cli-overview/xygeni-cli-docker-image.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.
