Clair的2.X 版本安装部署及使用

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 (重要)

https://stackoverflow.com/questions/21001387/how-do-i-set-the-gopath-environment-variable-on-ubuntu-what-file-must-i-edit/53026674#53026674

安装
# Clone the repo
git clone [email protected]: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

你可能感兴趣的:(Clair的2.X 版本安装部署及使用)