clair-local-scan icon indicating copy to clipboard operation
clair-local-scan copied to clipboard

The first time I start clair-local-scan it crashes. Have to start clair-local-scan twice.

Open larspederamlie opened this issue 3 years ago • 1 comments

We've been running in Azure pipelines for over a year without any problems, but now we have to start the local scan twice.

This is our scan script:

docker run -d --name db arminc/clair-db sleep 1 # wait for db to come up

docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan sleep 15

docker rm clair docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan

sleep 1

DOCKER_GATEWAY=$(docker network inspect bridge --format "{{range .IPAM.Config}}{{.Gateway}}{{end}}") wget -qO clair-scanner https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 && chmod +x clair-scanner ./clair-scanner -t Critical --ip="$DOCKER_GATEWAY" "${CONTAINERREGISTRYSERVICECONNECTION}.azurecr.io/${IMAGEREPOSITORY}:${IMAGETAG}"

docker stop db docker stop clair

docker rm db docker rm clair

larspederamlie avatar Apr 23 '21 11:04 larspederamlie

Same as #57

chadlwilson avatar Apr 27 '21 13:04 chadlwilson