diff --git a/Dockerfile b/Dockerfile index d655f74..ccfeac3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV CVE_BASE=/opt/cve ENV PATH=${PATH}:${CVE_BASE}/bin +ENV CVE_SEARCH_VERSION=4.0 RUN apt-get update && apt-get install -y --no-install-recommends curl cron && \ curl -s 'https://www.dotdeb.org/dotdeb.gpg' | apt-key add - && \ @@ -16,7 +17,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl cron && \ RUN apt-get update && \ apt-get install -y --no-install-recommends \ + apt-utils \ + file \ git \ + make \ python3 \ python3-pip \ python3-lxml \ @@ -26,11 +30,15 @@ RUN apt-get update && \ 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 && \ - git clone https://github.com/cve-search/cve-search.git ${CVE_BASE} && \ + 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 && \ pip3 install setuptools --upgrade && \ pip3 install wheel --upgrade && \ pip3 install -r ${CVE_BASE}/requirements.txt && \ - apt-get autoremove --purge -y python3-dev gcc && \ + apt-get autoremove --purge -y \ + gcc \ + make \ + python3-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.withdb b/Dockerfile.withdb index 00c0f62..6ff7d0c 100644 --- a/Dockerfile.withdb +++ b/Dockerfile.withdb @@ -8,6 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV CVE_BASE=/opt/cve ENV PATH=${PATH}:${CVE_BASE}/bin +ENV CVE_SEARCH_VERSION=4.0 RUN apt-get update && apt-get install -y --no-install-recommends curl cron && \ curl -s 'https://www.dotdeb.org/dotdeb.gpg' | apt-key add - && \ @@ -16,7 +17,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl cron && \ RUN apt-get update && \ apt-get install -y --no-install-recommends \ + apt-utils \ + file \ git \ + make \ python3 \ python3-pip \ python3-lxml \ @@ -26,11 +30,15 @@ RUN apt-get update && \ 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 && \ - git clone https://github.com/cve-search/cve-search.git ${CVE_BASE} && \ + 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 && \ pip3 install setuptools --upgrade && \ pip3 install wheel --upgrade && \ pip3 install -r ${CVE_BASE}/requirements.txt && \ - apt-get autoremove --purge -y python3-dev gcc && \ + apt-get autoremove --purge -y \ + gcc \ + make \ + python3-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 32b1439..950b1c7 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -119,7 +119,7 @@ do show_help ;; -i|--initialize) - update_repo + # update_repo start_mongodb start_redis @@ -133,13 +133,13 @@ do fi ;; -u|--update) - update_repo + # update_repo start_mongodb start_redis update_database ;; -r|--repopulate) - update_repo + # update_repo start_mongodb start_redis repopulate_database