Share feedback
Answers are generated based on the documentation.

docker scout policy

内容説明Evaluate local Rego policies against an image and display the results (experimental)
利用方法docker scout policy [IMAGE | REPO]

試験的

このコマンドは試験的なものです。

試験的機能はテスト向けに意図されたものであり、その機能に関してのフィードバックを得る目的があります。 この機能はリリース時に予告なく変更される場合があり、また今後のリリースに向けて削除されることがあります。

内容説明

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.

オプション

オプションデフォルト内容説明
-e, --exit-codeReturn exit code '2' if policies are not met, '0' otherwise
--only-policyComma separated list of policies to evaluate
--orgNamespace of the Docker organization
-o, --outputWrite the report to a file
--platformPlatform of image to evaluate policies against
--policy-bundleOCI reference of a policy bundle to evaluate (repeatable)
--policy-configPath or http(s) URL to a JSON file configuring policy enablement and inputs
--policy-dirPath to a directory of local .rego policy files (repeatable)
--policy-filePath or http(s) URL to a .rego policy file (repeatable)
--result-fileWrite the full Rego evaluation result (pass, violations, query bindings and OPA metrics) of each evaluated policy to a JSON file (useful when iterating on local --policy-file policies)

利用例

Evaluate policies against an image and display the results

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

Evaluate policies against an image for a specific organization

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

Evaluate policies against an image with a specific platform

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

Compare policy results for a repository in a specific environment

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

サブコマンド

コマンド内容説明
docker scout policy publishPackage local Rego policies into an OCI bundle and push it to a registry (experimental)