Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 281a6b0

Browse files
committed
Docker scan command is being removed
Please see docker scout command instead Learn more at https://docs.docker.com/engine/reference/commandline/scout/ Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
1 parent 284fb08 commit 281a6b0

37 files changed

Lines changed: 54 additions & 3486 deletions

.github/workflows/build-pr.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,12 @@ jobs:
5151
cache: true
5252
id: go
5353

54-
- name: Download binaries
55-
run: make -f builder.Makefile download
56-
5754
- name: Build binary
5855
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile build
5956

6057
- name: Build Cross
6158
run: make cross
6259

63-
- name: Unit Tests
64-
run: make test-unit
65-
66-
- name: End-to-end Tests
67-
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile e2e
68-
6960
- name: Upload binary artifact
7061
uses: actions/upload-artifact@v2
7162
with:

.github/workflows/release-weekly-build.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ jobs:
6868
cache: true
6969
id: go
7070

71-
- name: Download binaries
72-
run: make -f builder.Makefile download
73-
7471
- name: Build binary
7572
env:
7673
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
@@ -79,22 +76,6 @@ jobs:
7976
E2E_HUB_TOKEN: ${{ secrets.E2E_HUB_TOKEN }}
8077
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile build
8178

82-
- name: E2E
83-
env:
84-
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
85-
E2E_HUB_URL: ${{ secrets.E2E_HUB_URL }}
86-
E2E_HUB_USERNAME: ${{ secrets.E2E_HUB_USERNAME }}
87-
E2E_HUB_TOKEN: ${{ secrets.E2E_HUB_TOKEN }}
88-
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile e2e
89-
90-
- name: Unit test
91-
env:
92-
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
93-
E2E_HUB_URL: ${{ secrets.E2E_HUB_URL }}
94-
E2E_HUB_USERNAME: ${{ secrets.E2E_HUB_USERNAME }}
95-
E2E_HUB_TOKEN: ${{ secrets.E2E_HUB_TOKEN }}
96-
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile test-unit
97-
9879
- name: Build Mac arm64 binary
9980
if: ${{ matrix.os == 'macos-latest' }}
10081
run: make TAG_NAME=${{ github.event.inputs.tag }} -f builder.Makefile build-mac-arm64

Makefile

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,10 @@ BUILD_ARGS := --build-arg GO_VERSION=$(GO_VERSION)\
1818
--build-arg CLI_VERSION=$(CLI_VERSION)\
1919
--build-arg ALPINE_VERSION=$(ALPINE_VERSION)\
2020
--build-arg GOLANGCI_LINT_VERSION=$(GOLANGCI_LINT_VERSION) \
21-
--build-arg TAG_NAME=$(GIT_TAG_NAME) \
22-
--build-arg GOTESTSUM_VERSION=$(GOTESTSUM_VERSION) \
23-
--build-arg SNYK_IMAGE_DIGEST=$(SNYK_IMAGE_DIGEST)
24-
25-
E2E_ENV := --env E2E_TEST_AUTH_TOKEN \
26-
--env E2E_HUB_URL \
27-
--env E2E_HUB_USERNAME \
28-
--env E2E_HUB_TOKEN \
29-
--env E2E_TEST_NAME
21+
--build-arg TAG_NAME=$(GIT_TAG_NAME)
3022

3123
.PHONY: all
32-
all: lint validate build test
24+
all: lint validate build
3325

3426
.PHONY: build
3527
build: ## Build docker-scan in a container
@@ -49,24 +41,6 @@ install: build ## Install docker-scan to your local cli-plugins directory
4941
mkdir -p $(HOME)/.docker/cli-plugins
5042
cp bin/$(PLATFORM_BINARY) $(HOME)/.docker/cli-plugins/$(BINARY)
5143

52-
.PHONY: test ## Run unit tests then end-to-end tests
53-
test: test-unit e2e
54-
55-
.PHONY: e2e-build
56-
e2e-build:
57-
docker build $(BUILD_ARGS) . --target e2e -t docker-scan:e2e
58-
59-
.PHONY: e2e
60-
e2e: e2e-build ## Run the end-to-end tests
61-
@docker run $(E2E_ENV) --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(shell go env GOCACHE):/root/.cache/go-build docker-scan:e2e
62-
63-
test-unit-build:
64-
docker build $(BUILD_ARGS) . --target test-unit -t docker-scan:test-unit
65-
66-
.PHONY: test-unit
67-
test-unit: test-unit-build ## Run unit tests
68-
docker run --rm -v $(shell go env GOCACHE):/root/.cache/go-build docker-scan:test-unit
69-
7044
.PHONY: lint
7145
lint: ## Run the go linter
7246
@docker build . --target lint

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
# Docker Scan
44

5+
:warning:
6+
7+
The `docker scan` command has been removed.
8+
9+
To continue learning about the vulnerabilities of your images, and many other features, use the new `docker scout` command.
10+
11+
Run `docker scout --help`, or learn more at https://docs.docker.com/engine/reference/commandline/scout/
12+
13+
---
14+
515
Docker Scan is a Command Line Interface to run vulnerability detection on your Dockerfiles and Docker images.
616

717

builder.Makefile

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,13 @@ PKG_NAME=github.com/docker/scan-cli-plugin
1414
STATIC_FLAGS= CGO_ENABLED=0
1515
LDFLAGS := "-s -w \
1616
-X $(PKG_NAME)/internal.GitCommit=$(COMMIT) \
17-
-X $(PKG_NAME)/internal.Version=$(TAG_NAME) \
18-
-X $(PKG_NAME)/internal/provider.ImageDigest=$(SNYK_IMAGE_DIGEST) \
19-
-X $(PKG_NAME)/internal/provider.SnykDesktopVersion=$(SNYK_DESKTOP_VERSION)"
17+
-X $(PKG_NAME)/internal.Version=$(TAG_NAME)"
2018
GO_BUILD = $(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS)
2119

22-
SNYK_DOWNLOAD_NAME:=snyk-linux
23-
SNYK_BINARY:=snyk
24-
PWD:=$(shell pwd)
25-
ifeq ($(GOOS),windows)
26-
SNYK_DOWNLOAD_NAME:=snyk-win.exe
27-
SNYK_BINARY=snyk.exe
28-
PWD=$(subst \,/,$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))))
29-
endif
30-
ifeq ($(GOOS),darwin)
31-
SNYK_DOWNLOAD_NAME:=snyk-macos
32-
endif
33-
34-
ifneq ($(strip $(E2E_TEST_NAME)),)
35-
RUN_TEST=-test.run $(E2E_TEST_NAME)
36-
endif
37-
38-
VARS:= SNYK_DESKTOP_VERSION=${SNYK_DESKTOP_VERSION}\
39-
SNYK_USER_VERSION=${SNYK_USER_VERSION}\
40-
SNYK_OLD_VERSION=${SNYK_OLD_VERSION}\
41-
DOCKER_CONFIG=$(PWD)/docker-config\
42-
SNYK_OLD_PATH=$(PWD)/docker-config/snyk-old\
43-
SNYK_USER_PATH=$(PWD)/docker-config/snyk-user\
44-
SNYK_DESKTOP_PATH=$(PWD)/docker-config/snyk-desktop
45-
4620
.PHONY: lint
4721
lint:
4822
golangci-lint run --timeout 10m0s ./...
4923

50-
.PHONY: e2e
51-
e2e:
52-
mkdir -p docker-config/scan
53-
mkdir -p docker-config/cli-plugins
54-
cp ./bin/${PLATFORM_BINARY} docker-config/cli-plugins/${BINARY}
55-
# TODO: gotestsum doesn't forward ldflags to go test with golang 1.15.0, so moving back to go test temporarily
56-
$(VARS) go test ./e2e $(RUN_TEST) -ldflags=$(LDFLAGS)
57-
58-
.PHONY: test-unit
59-
test-unit:
60-
gotestsum $(shell go list ./... | grep -vE '/e2e')
61-
6224
cross:
6325
GOOS=linux GOARCH=amd64 $(GO_BUILD) -o dist/docker-scan_linux_amd64 ./cmd/docker-scan
6426
GOOS=linux GOARCH=arm64 $(GO_BUILD) -o dist/docker-scan_linux_arm64 ./cmd/docker-scan
@@ -78,20 +40,3 @@ build-linux-arm64:
7840
build:
7941
mkdir -p bin
8042
$(GO_BUILD) -o bin/$(PLATFORM_BINARY) ./cmd/docker-scan
81-
82-
# For multi-platform (windows,macos,linux) github actions
83-
.PHONY: download
84-
download:
85-
mkdir -p docker-config/snyk-user
86-
curl https://github.com/snyk/snyk/releases/download/v${SNYK_USER_VERSION}/${SNYK_DOWNLOAD_NAME} -L -s -S -o docker-config/snyk-user/${SNYK_BINARY}
87-
chmod +x docker-config/snyk-user/${SNYK_BINARY}
88-
89-
mkdir -p docker-config/snyk-old
90-
curl https://github.com/snyk/snyk/releases/download/v${SNYK_OLD_VERSION}/${SNYK_DOWNLOAD_NAME} -L -s -S -o docker-config/snyk-old/${SNYK_BINARY}
91-
chmod +x docker-config/snyk-old/${SNYK_BINARY}
92-
93-
mkdir -p docker-config/snyk-desktop
94-
curl https://github.com/snyk/snyk/releases/download/v${SNYK_DESKTOP_VERSION}/${SNYK_DOWNLOAD_NAME} -L -s -S -o docker-config/snyk-desktop/${SNYK_BINARY}
95-
chmod +x docker-config/snyk-desktop/${SNYK_BINARY}
96-
97-
GO111MODULE=on go install gotest.tools/gotestsum@v${GOTESTSUM_VERSION}

cmd/docker-scan/job_windows.go

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)