Skip to content

Commit

Permalink
Merge pull request #160 from usiusi360/Fix-docker-vulsrepo-install
Browse files Browse the repository at this point in the history
Fix-docker-vulsrepo-install
  • Loading branch information
kotakanbe authored Aug 30, 2016
2 parents 51d13f4 + d8e6d4e commit 2721dc0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 64 deletions.
40 changes: 12 additions & 28 deletions setup/docker/dockerfile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,6 @@ RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \
&& ln -s /usr/local/glide/linux-amd64/glide /usr/local/bin/ \
&& rm glide.tar.gz

# nginx Install
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
nginx \
nginx-module-xslt \
nginx-module-geoip \
nginx-module-image-filter \
nginx-module-perl \
nginx-module-njs \
gettext-base \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*

RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

COPY nginx.conf /etc/nginx/nginx.conf

#Vuls Install
ENV VULS_ROOT /opt/vuls
RUN mkdir -p /var/log/vuls ${VULS_ROOT}/conf /root/.ssh/
Expand All @@ -77,13 +55,19 @@ RUN chmod 755 ${VULS_ROOT}/scripts/*


#Vulrepo Install
RUN git clone https://github.com/usiusi360/vulsrepo /tmp/vulsrepo
RUN mkdir /usr/share/nginx/html/vulsrepo/
RUN cp -rp /tmp/vulsrepo/dist/* /usr/share/nginx/html/vulsrepo
RUN rm -rf /tmp/vulsrepo
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apache2 \
libcgi-pm-perl \
libjson-perl \
&& rm -rf /var/lib/apt/lists/* \
&& cd /var/www/html/ \
&& git clone https://github.com/usiusi360/vulsrepo \
&& cp /var/www/html/vulsrepo/dist/cgi/vulsrepo.conf.sample /etc/apache2/conf-enabled/vulsrepo.conf \
&& a2enmod cgid

#Home
WORKDIR /opt/vuls
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]
ENTRYPOINT service apache2 start && tail -f /dev/null


32 changes: 0 additions & 32 deletions setup/docker/dockerfile/nginx.conf

This file was deleted.

2 changes: 1 addition & 1 deletion setup/docker/dockerfile/scripts/scan_for_vulsrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ VULS_CONF=${VULS_ROOT}/conf
NGINX_VULSREPO_ROOT=/usr/share/nginx/html/vulsrepo
cd $VULS_ROOT
vuls scan -report-json --cve-dictionary-dbpath=${VULS_ROOT}/cve.sqlite3 -config=${VULS_CONF}/config.toml
ln -sf ${VULS_ROOT}/results/current ${NGINX_VULSREPO_ROOT}/current
ln -sf ${VULS_ROOT}/results ${NGINX_VULSREPO_ROOT}/results
5 changes: 2 additions & 3 deletions setup/docker/dockerfile/scripts/update_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ git pull origin master
glide install
go install

git clone https://github.com/usiusi360/vulsrepo /tmp/vulsrepo
cp -rp /tmp/vulsrepo/src/* /usr/share/nginx/html/vulsrepo
rm -rf /tmp/vulsrepo

cd /var/www/html/vulsrepo
git pull origin master

0 comments on commit 2721dc0

Please sign in to comment.