Clair两种方式部署Sever与Client:
Client使用命令行工具扫描
通过docker启动Server
docker run -p 5432:5432 -d --name db arminc/clair-db:latest
docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:latest
安装client
安装Golang
https://golang.org/doc/install
设置GOPATH (重要)
安装
# Clone the repo
git clone git@github.com:arminc/clair-scanner.git
# Build and install
cd clair-scanner
make build
make installLocal
使用
cd $GOPATH
./clair-scanner --ip host.docker.internal postgres:9.6
Client 使用docker
通过docker启动Server
docker run -d --name db arminc/clair-db:latest
docker run -d --link db:postgres --name clair arminc/clair-local-scan:latest
通过client的docker来启动扫描
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --network=container:clair ovotech/clair-scanner clair-scanner postgres:9.6
reference:
https://github.com/arminc/clair-scanner/issues/63#issuecomment-516810971
https://github.com/arminc/clair-scanner/issues/42#issuecomment-586356136
有疑问加站长微信联系(非本文作者)