forked from digitalshadows/docker-cve-search
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
62 lines (55 loc) · 2.33 KB
/
Dockerfile
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
FROM mongo:focal
RUN echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal main restricted universe multiverse" > /etc/apt/sources.list && \
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-security main restricted universe multiverse" >> /etc/apt/sources.list
ARG DEBIAN_FRONTEND=noninteractive
ENV CVE_BASE=/opt/cve
ENV PATH=${PATH}:${CVE_BASE}/bin
ENV CVE_SEARCH_VERSION=4.2.1
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
cron \
curl \
file \
git \
make \
python3 \
python3-pip \
python3-lxml \
python3-dev \
gcc \
redis-server && \
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \
mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/mongo-entrypoint.sh && \
rm -f /entrypoint.sh && \
mkdir -p ${CVE_BASE} && \
curl -L "https://github.com/cve-search/cve-search/archive/v${CVE_SEARCH_VERSION}.tar.gz" | tar -C "${CVE_BASE}" -xz --strip-components 1 --keep-newer-files && \
python3 -m pip install --upgrade --force pip && \
python3 -m pip install setuptools --upgrade && \
python3 -m pip install wheel --upgrade && \
python3 -m pip install -r ${CVE_BASE}/requirements.txt && \
apt-get autoremove --purge -y \
gcc \
make \
python3-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD docker-entrypoint.sh /usr/local/bin/cvedb
COPY auto-update.cron /etc/cron.d/auto-update.cron
RUN cd $CVE_BASE && \
sed 's/Host: 127.0.0.1/Host: 0.0.0.0/' \
etc/configuration.ini.sample \
> etc/configuration.ini && \
sed -i 's/Password: RedisPassword/#Password: RedisPassword/g' etc/configuration.ini && \
sed -i 's/Debug: True/Debug: False/g' etc/configuration.ini && \
sed -i 's/SSL: True/SSL: False/g' etc/configuration.ini && \
sed -i 's/LoginRequired: False/LoginRequired: True/g' etc/configuration.ini && \
echo "Configuring auto-update..." && \
chmod 0644 /etc/cron.d/auto-update.cron && \
crontab /etc/cron.d/auto-update.cron && \
mkdir -p /opt/cve/log && \
touch /opt/cve/log/auto-update.log
EXPOSE 5000
ENTRYPOINT ["cvedb"]
CMD ["-i", "-a", "-w", "t"]