docker 侦察策略

DescriptionEvaluate policies against an image and display the policy evaluation results (experimental)
Usagedocker scout policy [IMAGE | REPO]

实验性

此命令是实验性的。

实验性功能旨在用于测试和反馈,因为它们的功能或设计可能会在版本之间更改而不发出警告,或者可能在未来的版本中完全移除。

描述

docker scout policy 命令评估针对镜像的策略。 镜像分析会上传到 Docker Scout,在那里策略会被评估。

策略评估结果可能需要几分钟才能可用。

选项

OptionDefaultDescription
-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 pull policy results from
--to-envName of the environment to compare to
--to-latestLatest image processed to compare to

示例

评估针对图像的策略并显示结果

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

针对特定组织的图像评估策略

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

针对特定平台的镜像评估策略

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

比较特定环境中仓库的策略结果

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