Home Explore Blog Models CI



docker

_vendor/github.com/docker/scout-cli/docs/scout_policy.md
e583c570f9719ef6858309fc7973c13b16ef1327af5716b00000000300000839
# docker scout policy

<!---MARKER_GEN_START-->
Evaluate policies against an image and display the policy evaluation results (experimental)

### Options

| Name                | Type          | Default | Description                                                 |
|:--------------------|:--------------|:--------|:------------------------------------------------------------|
| `-e`, `--exit-code` |               |         | Return exit code '2' if policies are not met, '0' otherwise |
| `--only-policy`     | `stringSlice` |         | Comma separated list of policies to evaluate                |
| `--org`             | `string`      |         | Namespace of the Docker organization                        |
| `-o`, `--output`    | `string`      |         | Write the report to a file                                  |
| `--platform`        | `string`      |         | Platform of image to pull policy results from               |
| `--to-env`          | `string`      |         | Name of the environment to compare to                       |
| `--to-latest`       |               |         | Latest image processed to compare to                        |


<!---MARKER_GEN_END-->

## Description

The `docker scout policy` command evaluates policies against an image.
The image analysis is uploaded to Docker Scout where policies get evaluated.

The policy evaluation results may take a few minutes to become available.

## Examples

### Evaluate policies against an image and display the results

```console
$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1
```

### Evaluate policies against an image for a specific organization

```console
$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --org dockerscoutpolicy
```

### Evaluate policies against an image with a specific platform

```console
$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --platform linux/amd64
```

### Compare policy results for a repository in a specific environment

```console
$ docker scout policy dockerscoutpolicy/customers-api-service --to-env production
```

Chunks
a6f22321 (1st chunk of `_vendor/github.com/docker/scout-cli/docs/scout_policy.md`)
Title: Docker Scout Policy Command
Summary
The `docker scout policy` command evaluates policies against a Docker image and displays the results. Image analysis is uploaded to Docker Scout for policy evaluation. Options include specifying an organization, platform, and comparing results to a specific environment. The policy evaluation results may take a few minutes to become available.