百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

docker.scan-cli-plugin

> DevOps
开源

Docker Scan 是一个命令行接口,可用于在 Dockerfile 和 Docker 映像上运行漏洞检测。

184 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

Docker Scan 是一个命令行接口,可用于在 Dockerfile 和 Docker 映像上运行漏洞检测。

Docker Scan

:warning:

The docker scan command has been removed.

To continue learning about the vulnerabilities of your images, and many other features, use the new docker scout command.

Run docker scout --help, or learn more at https://docs.docker.com/engine/reference/commandline/scout/


Docker Scan is a Command Line Interface to run vulnerability detection on your Dockerfiles and Docker images.

Table of Contents

  • How to use it
    • Third Party consent
    • Scan Image or Dockerfile
    • Provider Authentication
  • Install Docker Scan
    • Mac & Windows
    • Linux
  • Build Docker Scan
  • Contributing

How to use it

Login and Third Party Providers

You need to be logged into the Docker Hub in order to use the docker scan command. Docker Scan works with third party providers to detect vulnerabilities, the plugin will ask for your consent before sending any data to the provider.

bash
$ docker scan hello-world
? Docker Scan relies upon access to Snyk a third party provider, do you consent to proceed using Snyk? (y/N)

Scanning

Docker Scan allows you to scan existing Docker images by name or ID.

  • You can then use docker scan DOCKER_IMAGE:
bash
$  docker scan hello-world

  Testing hello-world...

  Organization:      docker-desktop-test
  Package manager:   linux
  Project name:      docker-image|hello-world
  Docker image:      hello-world
  Licenses:          enabled

  ✓ Tested 0 dependencies for known issues, no vulnerable paths found.

  Note that we do not currently have vulnerability data for your image.

If you want more details, you can provide the Dockerfile used to create the image

  • the syntax is docker scan -f PATH_TO_DOCKERFILE DOCKER_IMAGE

If we apply the option to the current repository, we have:

…

When using the scan command with the -f flag, you can exclude the base image (i.e.: that specified in the Dockerfile with the FROM directive) vulnerabilities from your report by adding the --exclude-base tag.

…

You can also display the scan result as a JSON output by adding the --json flag to the command:

…

In addition to the --json flag, you can use the --group-issues flag to display only once a vulnerability

…

You can find all the sources of the vulnerability in the from section.

If you want to see the dependency tree of your image, you can use the --dependency-tree flag, to display all the dependencies before the scan result

…

If you want to only display some level of vulnerabilities, the --severity flag allows you to choose between 3 levels of vulnerabilities low,medium or high. By using this tag you will only report vulnerabilities of the provided level or higher.

…

Provider Authentication

If you have an existing Snyk account, you can directly use your auth token

bash
$ docker scan --login --token PROVIDER_AUTH_TOKEN

You need to get a Snyk API token and then use it like this

bash
$ docker scan --login --token c68dc480-27bd-45ee-9f5c-XXXXXXXXXXXX

Your account has been authenticated. Snyk is now ready to be used.

If you use the --login command without any token, you will be redirected to the Snyk website to login.

Install Docker Scan

On macOS & Windows:

Docker Desktop comes with Docker scan already installed. Just try to use the plugin, open a terminal and write the following command:

…

If you get the following error message, you're not using the latest version of Docker Desktop docker: 'scan' is not a docker command.

On Linux

Docker packaging on Linux comes with Docker scan plugin. You can simply install Docker following the standard linux install

Just try to use the plugin, open a terminal and type the following command:

bash
$ docker scan
Usage:    docker scan [OPTIONS] IMAGE

If you get the following error message, you're not using the latest version of Docker on Linux docker: 'scan' is not a docker command.

Alternatively, you can manually install the scan docker plugin on top of your existing docker setup : Download the binary from the latest release and copy it in the cli-plugins directory

bash
mkdir -p ~/.docker/cli-plugins && \
curl https://github.com/docker/scan-cli-plugin/releases/latest/download/docker-scan_linux_amd64 -L -s -S -o ~/.docker/cli-plugins/docker-scan &&\
chmod +x ~/.docker/cli-plugins/docker-scan

How to build docker scan

You'll find all the commands to build, run and test Docker Scan inside the BUILDING.md file.

Contributing

Want to contribute to Docker Scan? Awesome! First be sure to read the Code of conduct. You can find information about contributing to this project in the CONTRIBUTING.md

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Godockerdocker-containerdocker-imagedockerfile

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理