简体   繁体   English

运行 docker 扫描<img>在 ubuntu 20.04 返回错误

[英]Running docker scan <image> returns an error on ubuntu 20.04

When I tried scanning local images, like the hello-world image, using docker scan hello-world , I get this error当我尝试使用docker scan hello-world扫描本地图像(如 hello-world 图像)时,出现此错误

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

My docker version is我的 docker 版本是

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

When I tried scanning local images, like the hello-world image, using docker scan hello-world , I get this error当我尝试使用docker scan hello-world扫描本地图像(如 hello-world 图像)时,我收到此错误

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

My docker version is我的 docker 版本是

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

There is a plugin available:有一个插件可用:

Requirement: apt knows about the docker-repositories要求: apt 了解 docker-repositories

This should be already fulfilled after following the install-guide at https://docs.docker.com/engine/install/ubuntu/按照https://docs.docker.com/engine/install/ubuntu/上的安装指南进行操作后,这应该已经完成

Example:例子:

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

Installation:安装:

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

Running docker scan will reveal more requirements:运行docker scan将显示更多要求:

  • login to Docker Hub登录 Docker 中心
  • consent to access Snyk (For more information search the web for docker Snyk .)同意访问 Snyk (有关更多信息,请在 web 中搜索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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM