mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
Add comparative analysis with anchore-engine (#78)
* add comparative analysis * remove extra comma from compare script tuple Co-authored-by: Alfredo Deza <adeza@anchore.com> Co-authored-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
co-authored by
Alfredo Deza
parent
3f090f9647
commit
61f51d80bb
@@ -0,0 +1,27 @@
|
||||
IMAGE = "centos:8"
|
||||
IMAGE_CLEAN = $(shell echo $(IMAGE) | tr ":" "_")
|
||||
IMGBOM_DIR = imgbom-reports
|
||||
IMGBOM_REPORT = $(IMGBOM_DIR)/$(IMAGE_CLEAN).json
|
||||
INLINE_DIR = inline-reports
|
||||
INLINE_REPORT = $(INLINE_DIR)/$(IMAGE_CLEAN)-content-os.json
|
||||
|
||||
.PHONY: bootstrap
|
||||
|
||||
all: compare
|
||||
|
||||
compare: $(INLINE_REPORT) $(IMGBOM_REPORT)
|
||||
docker build -t compare-imgbom:latest .
|
||||
docker run compare-imgbom:latest $(IMAGE)
|
||||
|
||||
$(INLINE_REPORT):
|
||||
echo "Creating $(INLINE_REPORT)..."
|
||||
mkdir -p $(INLINE_DIR)
|
||||
curl -s https://ci-tools.anchore.io/inline_scan-v0.7.0 | bash -s -- -p -r $(IMAGE)
|
||||
mv anchore-reports/* $(INLINE_DIR)/
|
||||
rmdir anchore-reports
|
||||
|
||||
$(IMGBOM_REPORT):
|
||||
echo "Creating $(IMGBOM_REPORT)..."
|
||||
mkdir -p $(IMGBOM_DIR)
|
||||
docker pull $(IMAGE)
|
||||
go run ../main.go centos:latest -o json > $(IMGBOM_REPORT)
|
||||
Reference in New Issue
Block a user