有人可以帮我用一个与 git@github.com:Charlie-belmer/Docker-security-example.git 相对相同的 docker 图像设置 clair
version: '2.1'
services:
postgres:
image: postgres:12
restart: unless-stopped
volumes:
- ./docker-utils/postgres-data/:/var/lib/postgresql/data:rw
environment:
- POSTGRES_PASSWORD=ChangeMe
- POSTGRES_USER=clair
- POSTGRES_DB=clair
clair:
image: quay.io/coreos/clair:v4.3.4
restart: unless-stopped
volumes:
- ./docker-utils/clair-config/:/config/:ro
- ./docker-utils/clair-tmp/:/tmp/:rw
depends_on:
postgres:
condition: service_started
command: [-conf, /config/config.yml]
user: root
clairctl:
image: jgsqware/clairctl:latest
restart: unless-stopped
environment:
- DOCKER_API_VERSION=1.41
volumes:
- ./docker-utils/clairctl-reports/:/reports/:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
clair:
condition: service_started
user: root
我得到的错误是 2022/02/25 04:20:33 failed to validate config: indexer mode requires a database connection string
它与 clair 的 2.0.6 ( https://github.com/Charlie-belmer/Docker-security-example/blob/master/clair/docker-compose.yml ) 完美配合。我应该如何找出问题所在?Clair 的 github 没有用,因为它们没有为我的 CI/CD 提供单个 docker 文件。任何帮助,将不胜感激。