8

当我尝试使用 扫描本地图像(例如 hello-world 图像)时,docker scan hello-world出现此错误

docker: 'scan' is not a docker command.
See 'docker --help'

我的码头工人版本是

Client: Docker Engine - Community
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:17:43 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
4

1 回答 1

6

有一个插件可用:

要求: apt 了解 docker-repositories

遵循https://docs.docker.com/engine/install/ubuntu/上的安装指南后,这应该已经完成

例子:

$ cat /etc/apt/sources.list.d/docker.list 
deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

安装:

$ sudo apt update
$ sudo apt install docker-scan-plugin

运行docker scan会揭示更多需求:

  • 登录 Docker Hub
  • 同意访问 Snyk (有关更多信息,请在网上搜索docker Snyk。)
$ docker scan hello-world
Docker Scan relies upon access to Snyk, a third party provider, do you consent to proceed using Snyk? (y/N)
y
failed to get DockerScanID: You need to be logged in to Docker Hub to use scan feature.
please login to Docker Hub using the Docker Login command
于 2021-04-20T15:42:44.777 回答