-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile.ubi7
58 lines (45 loc) · 1.54 KB
/
Dockerfile.ubi7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ARG GIT_TAG
ARG REPO_NAME
FROM ${REPO_NAME}:${GIT_TAG}-centos7-build-env AS build-env
FROM registry.redhat.io/ubi7/ubi:7.6
LABEL maintainer "[email protected]"
ENV CLAIRDIR /clair
ENV CLAIRCONF /clair/config
RUN mkdir $CLAIRDIR
WORKDIR $CLAIRDIR
RUN INSTALL_PKGS="\
python-setuptools \
git \
rpm \
xz \
" && \
rm /etc/rhsm-host && \
yum -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False install $INSTALL_PKGS && \
yum -y clean all
RUN easy_install supervisor && \
easy_install pip && \
pip install supervisor-stdout
# Copy built binaries into the runtime image
COPY --from=build-env /go/bin/cfssl /usr/local/bin/cfssl
COPY --from=build-env /go/bin/cfssljson /usr/local/bin/cfssljson
COPY --from=build-env /go/bin/clair /usr/local/bin/clair
COPY --from=build-env /go/bin/jwtproxy /usr/local/bin/jwtproxy
# Add the init scripts
ADD generate_mitm_ca.rhel.sh $CLAIRDIR/generate_mitm_ca.sh
ADD clair-entrypoint.sh $CLAIRDIR/clair-entrypoint.sh
ADD supervisord.conf $CLAIRDIR/supervisord.conf
# Cleanup
RUN yum clean all && \
rm -rf /etc/pki/entitlement /etc/rhsm && \
rm -rf /var/cache/yum /tmp/* /var/tmp/* /root/.cache
RUN chgrp -R 0 $CLAIRDIR && \
chmod -R g=u $CLAIRDIR
RUN mkdir -p /tmp && chgrp 0 /tmp && chmod g=u /tmp && \
chmod g=u /etc/passwd
EXPOSE 6060 6061
VOLUME ["/clair/config", "/clair/certs"]
ENTRYPOINT ["/clair/clair-entrypoint.sh"]
CMD ["scanner"]
# root required to create and install certs
# https://jira.coreos.com/browse/QUAY-1468
# USER 1001