clair-local-scan
clair-local-scan copied to clipboard
The first time I start clair-local-scan it crashes. Have to start clair-local-scan twice.
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
Same as #57