-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile.rhel7
76 lines (60 loc) · 2.02 KB
/
Dockerfile.rhel7
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
ARG GIT_TAG
ARG REPO_NAME
FROM ${REPO_NAME}:${GIT_TAG}-centos7-build-env AS build-env
FROM registry.redhat.io/rhel7:7.6
LABEL maintainer "[email protected]"
ENV CLAIRDIR /clair
ENV CLAIRCONF /clair/config
RUN mkdir $CLAIRDIR
WORKDIR $CLAIRDIR
# Red Hat subscription entitlement
#
ARG SUBSCRIPTION_KEY
ADD ${SUBSCRIPTION_KEY} /tmp/
RUN subscription-manager import --certificate=/tmp/${SUBSCRIPTION_KEY} && \
rm -f /tmp/${SUBSCRIPTION_KEY}
RUN INSTALL_PKGS="\
python-setuptools \
git \
rpm \
xz \
" && \
rm /etc/rhsm-host && \
yum install -y yum-utils && \
yum-config-manager --quiet --disable "*" >/dev/null && \
yum-config-manager --quiet --enable \
rhel-7-server-rpms \
--save >/dev/null && \
yum -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False install $INSTALL_PKGS && \
yum -y update && \
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
# Remove subscription key
RUN subscription-manager remove --all
# Cleanup
RUN 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