diff --git a/setup/docker/README.md b/setup/docker/README.md index 70361cbf..76a577de 100644 --- a/setup/docker/README.md +++ b/setup/docker/README.md @@ -26,7 +26,9 @@ This image version is same as the github repository version. ```console $ for i in {2002..2016}; do \ docker run --rm -it \ - -v $PWD:/vuls vuls/go-cve-dictionary fetchnvd -years $i; \ + -v $PWD:/vuls \ + -v $PWD/go-cve-dictionary-log:/var/log/vuls \ + vuls/go-cve-dictionary fetchnvd -years $i; \ done ``` @@ -49,6 +51,7 @@ keyPath = "/root/.ssh/id_rsa" # path to ssh private key in docker $ docker run --rm \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ vuls/vuls configtest \ -config=./config.toml # path to config.toml in docker ``` @@ -59,6 +62,7 @@ $ docker run --rm \ $ docker run --rm \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ vuls/vuls prepare \ -config=./config.toml # path to config.toml in docker ``` @@ -69,6 +73,7 @@ $ docker run --rm \ $ docker run --rm -it \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ -v /etc/localtime:/etc/localtime:ro \ -e "TZ=Asia/Tokyo" \ vuls/vuls scan \ diff --git a/setup/docker/base/latest/Dockerfile b/setup/docker/base/latest/Dockerfile deleted file mode 100644 index 43b4aedd..00000000 --- a/setup/docker/base/latest/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM golang:1.7.1 - -MAINTAINER hikachan sadayuki-matsuno - -# glide install -ENV GLIDE_VERSION 0.12.2 -ENV GLIDE_DOWNLOAD_URL https://github.com/Masterminds/glide/releases/download/v$GLIDE_VERSION/glide-v$GLIDE_VERSION-linux-amd64.tar.gz -RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \ - && mkdir /usr/local/glide \ - && tar -C /usr/local/glide -xzf glide.tar.gz \ - && ln -s /usr/local/glide/linux-amd64/glide /usr/local/bin/ \ - && rm glide.tar.gz diff --git a/setup/docker/base/latest/README.md b/setup/docker/base/latest/README.md deleted file mode 100644 index f28d5088..00000000 --- a/setup/docker/base/latest/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Vuls-Base-Docker - -This is the Git repo of the official Docker image for vuls-base. -See the [Hub page](https://hub.docker.com/r/vuls/vuls-base/) for the full readme on how to use the Docker image and for information regarding contributing and issues. - -# Supported tags and respective `Dockerfile` links - -- [`latest` (*vuls-base:latest Dockerfile*)](https://github.com/future-architect/vuls/blob/master/setup/docker/base/latest/Dockerfile) - -# Caution - -This image is built per commit. -If you want to use the latest docker image, you should remove the existing image, and pull it once again. - - -# What is vuls-base? - -Base images of vuls and go-cve-dictionary. - diff --git a/setup/docker/go-cve-dictionary/latest/Dockerfile b/setup/docker/go-cve-dictionary/latest/Dockerfile index 8a464819..c201bec3 100644 --- a/setup/docker/go-cve-dictionary/latest/Dockerfile +++ b/setup/docker/go-cve-dictionary/latest/Dockerfile @@ -1,19 +1,17 @@ -FROM vuls/vuls-base:latest +FROM golang:latest MAINTAINER hikachan sadayuki-matsuno ENV REPOSITORY github.com/kotakanbe/go-cve-dictionary +ENV LOGDIR /var/log/vuls ENV WORKDIR /vuls # go-cve-dictionary install RUN git clone https://$REPOSITORY.git $GOPATH/src/$REPOSITORY \ && cd $GOPATH/src/$REPOSITORY \ - && glide install \ - && go build \ - && mv $GOPATH/src/$REPOSITORY/go-cve-dictionary /usr/local/bin \ - && chmod +x /usr/local/bin/go-cve-dictionary \ - && mkdir -p /var/log/vuls + && make install \ + && mkdir -p $LOGDIR -VOLUME $WORKDIR +VOLUME [$WORKDIR, $LOGDIR] WORKDIR $WORKDIR ENV PWD $WORKDIR diff --git a/setup/docker/go-cve-dictionary/latest/README.md b/setup/docker/go-cve-dictionary/latest/README.md index 60750f4c..9e16d257 100644 --- a/setup/docker/go-cve-dictionary/latest/README.md +++ b/setup/docker/go-cve-dictionary/latest/README.md @@ -22,12 +22,19 @@ This is tool to build a local copy of the NVD (National Vulnerabilities Database # How to use this image +## check vuls version + +``` +$ docker run --rm vuls/go-cve-dictionary -v +``` + ## fetchnvd ```console $ for i in {2002..2016}; do \ docker run --rm -it \ -v $PWD:/vuls \ + -v $PWD/go-cve-dictionary-log:/var/log/vuls \ vuls/go-cve-dictionary fetchnvd -years $i; \ done ``` @@ -36,11 +43,12 @@ $ for i in {2002..2016}; do \ ```console $ docker run -dt \ - --name go-cve-dictionary \ - -v $PWD:/vuls \ - --expose 1323 \ - -p 1323:1323 \ - vuls/go-cve-dictionary server --bind=0.0.0.0 + --name go-cve-dictionary \ + -v $PWD:/vuls \ + -v $PWD/go-cve-dictionary-log:/var/log/vuls \ + --expose 1323 \ + -p 1323:1323 \ + vuls/go-cve-dictionary server --bind=0.0.0.0 ``` Prease refer to [this](https://hub.docker.com/r/vuls/go-cve-dictionary). diff --git a/setup/docker/vuls/latest/Dockerfile b/setup/docker/vuls/latest/Dockerfile index 7ca2e8e1..1db73c55 100644 --- a/setup/docker/vuls/latest/Dockerfile +++ b/setup/docker/vuls/latest/Dockerfile @@ -1,19 +1,17 @@ -FROM vuls/vuls-base:latest +FROM golang:latest MAINTAINER hikachan sadayuki-matsuno ENV REPOSITORY github.com/future-architect/vuls +ENV LOGDIR /var/log/vuls ENV WORKDIR /vuls # go-cve-dictionary install RUN git clone https://$REPOSITORY.git $GOPATH/src/$REPOSITORY \ && cd $GOPATH/src/$REPOSITORY \ - && glide install \ - && go build \ - && mv $GOPATH/src/$REPOSITORY/vuls /usr/local/bin \ - && mkdir -p /var/log/vuls \ - && chmod +x /usr/local/bin/vuls + && make install \ + && mkdir -p $LOGDIR -VOLUME $WORKDIR +VOLUME [$WORKDIR, $LOGDIR] WORKDIR $WORKDIR ENV PWD $WORKDIR diff --git a/setup/docker/vuls/latest/README.md b/setup/docker/vuls/latest/README.md index 3210b54a..6b878599 100644 --- a/setup/docker/vuls/latest/README.md +++ b/setup/docker/vuls/latest/README.md @@ -21,6 +21,12 @@ Please see the [Documentation](https://github.com/future-architect/vuls) # How to use this image +## check vuls version + +``` +$ docker run --rm vuls/vuls -v +``` + ## configtest Create config.toml referring to [this](https://github.com/future-architect/vuls#configuration). @@ -40,6 +46,7 @@ keyPath = "/root/.ssh/id_rsa" # path to ssh private key in docker $ docker run --rm \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ vuls/vuls configtest ``` @@ -50,6 +57,7 @@ $ docker run --rm \ $ docker run --rm \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ vuls/vuls prepare \ -config=./config.toml # path to config.toml in docker ``` @@ -60,6 +68,7 @@ $ docker run --rm \ $ docker run --rm -it \ -v ~/.ssh:/root/.ssh:ro \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ -v /etc/localtime:/etc/localtime:ro \ vuls/vuls scan \ -cve-dictionary-dbpath=/vuls/cve.sqlite3 \ @@ -72,6 +81,7 @@ $ docker run --rm -it \ ```console $ docker run --rm -it \ -v $PWD:/vuls \ + -v $PWD/vuls-log:/var/log/vuls \ vuls/vuls tui ```