mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
Run clair with limited user
1>creat user clair 2>run clair with user clair
This commit is contained in:
parent
10199c10ef
commit
e9d1b89936
@ -35,14 +35,13 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- harbor-clair
|
- harbor-clair
|
||||||
container_name: clair
|
container_name: clair
|
||||||
image: vmware/clair-photon:v2.0.1
|
image: vmware/clair:v2.0.1-photon
|
||||||
restart: always
|
restart: always
|
||||||
cpu_quota: 150000
|
cpu_quota: 150000
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
volumes:
|
volumes:
|
||||||
- ./common/config/clair:/config
|
- ./common/config/clair:/config
|
||||||
command: [-config, /config/config.yaml]
|
|
||||||
logging:
|
logging:
|
||||||
driver: "syslog"
|
driver: "syslog"
|
||||||
options:
|
options:
|
||||||
|
@ -2,15 +2,18 @@ FROM vmware/photon:1.0
|
|||||||
|
|
||||||
RUN tdnf distro-sync -y \
|
RUN tdnf distro-sync -y \
|
||||||
&& tdnf erase vim -y \
|
&& tdnf erase vim -y \
|
||||||
&& tdnf install -y git bzr rpm xz \
|
&& tdnf install -y git shadow sudo bzr rpm xz python-xml \
|
||||||
&& tdnf clean all \
|
&& tdnf clean all \
|
||||||
&& mkdir /clair2.0.1/
|
&& mkdir /clair2.0.1/ \
|
||||||
|
&& groupadd -r -g 10000 clair \
|
||||||
|
&& useradd --no-log-init -m -r -g 10000 -u 10000 clair
|
||||||
COPY clair /clair2.0.1/
|
COPY clair /clair2.0.1/
|
||||||
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
EXPOSE 6060 6061
|
EXPOSE 6060 6061
|
||||||
|
RUN chown -R 10000:10000 /clair2.0.1 \
|
||||||
RUN chmod u+x /clair2.0.1/clair
|
&& chmod u+x /clair2.0.1/clair \
|
||||||
|
&& chmod u+x /docker-entrypoint.sh
|
||||||
ENTRYPOINT ["/clair2.0.1/clair"]
|
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -sS 127.0.0.1:6061/health || exit 1
|
||||||
|
USER clair
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
4
make/photon/clair/docker-entrypoint.sh
Normal file
4
make/photon/clair/docker-entrypoint.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
/clair2.0.1/clair -config /config/config.yaml
|
||||||
|
set +e
|
Loading…
Reference in New Issue
Block a user