Skip to content

Commit

Permalink
Merge pull request #18354 from Q-back/local-docker-build
Browse files Browse the repository at this point in the history
Local docker build
  • Loading branch information
andresriancho authored Feb 9, 2020
2 parents 8ef1c7c + 8cdbb38 commit 850893e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
25 changes: 12 additions & 13 deletions extras/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# w3af.org
# https://github.com/andresriancho/w3af/tree/master/extras

FROM ubuntu:12.04
FROM ubuntu:18.04
MAINTAINER Andres Riancho <[email protected]>

# Initial setup
Expand All @@ -22,9 +22,10 @@ RUN apt-get dist-upgrade -y

# Install basic and GUI requirements, python-lxml because it doesn't compile correctly from pip
RUN apt-get install -y python-pip build-essential libxslt1-dev libxml2-dev libsqlite3-dev \
libyaml-dev openssh-server python-dev git python-lxml wget libssl-dev \
libyaml-dev openssh-server python-dev git python-lxml wget \
xdot python-gtk2 python-gtksourceview2 ubuntu-artwork dmz-cursor-theme \
ca-certificates libffi-dev
ca-certificates libffi-dev zlib1g-dev nodejs nodejs-dev libssl1.0-dev \
node-gyp npm

# Add the w3af user
# TODO - actually use the w3af user instead of running everything as root
Expand All @@ -39,8 +40,7 @@ RUN mkdir -p /root/.ssh/
RUN cat /home/w3af/.ssh/w3af-docker.pub >> /root/.ssh/authorized_keys

# Get and install pip
RUN pip install --upgrade pip

RUN pip install --index-url=https://pypi.python.org/simple/ --upgrade pip
#
# We install some pip packages before adding the code in order to better leverage
# the docker cache
Expand All @@ -50,14 +50,13 @@ RUN pip install --upgrade pip
#
#tblib==0.2.0
#
RUN pip install pyClamd==0.4.0 PyGithub==1.21.0 GitPython==2.1.3 pybloomfiltermmap==0.3.14 \
esmre==0.3.1 phply==0.9.1 nltk==3.0.1 chardet==3.0.4 pdfminer==20140328 \
futures==3.2.0 pyOpenSSL==18.0.0 scapy-real==2.4.0 guess-language==0.2 cluster==1.1.1b3 \
msgpack-python==0.5.6 python-ntlm==1.0.1 halberd==0.2.4 darts.util.lru==0.5 \
ndg-httpsclient==0.4.0 pyasn1==0.4.2 Jinja2==2.7.3 \
vulndb==0.1.0 markdown==2.6.1 psutil==2.2.1 mitmproxy==0.12.1 \
ruamel.ordereddict==0.4.8 Flask==0.10.1 PyYAML==3.12 \
ds-store==1.1.2 termcolor==1.1.0 tldextract==1.7.2 pebble==4.3.8 \
RUN pip install setuptools-git>=1.1 pyClamd==0.4.0 PyGithub==1.21.0 GitPython==2.1.3 \
pybloomfiltermmap==0.3.14 esmre==0.3.1 phply==0.9.1 nltk==3.0.1 chardet==3.0.4 \
pdfminer==20140328 futures==3.2.0 pyOpenSSL==18.0.0 scapy==2.4.0 guess-language==0.2 \
cluster==1.1.1b3 msgpack-python==0.5.6 python-ntlm==1.0.1 halberd==0.2.4 \
darts.util.lru==0.5 ndg-httpsclient==0.4.0 pyasn1==0.4.2 Jinja2==2.7.3 vulndb==0.1.3 \
markdown==2.6.1 psutil==2.2.1 Tornado==4.5 mitmproxy==0.13 ruamel.ordereddict==0.4.8 \
Flask==0.10.1 PyYAML==3.12 ds-store==1.1.2 termcolor==1.1.0 tldextract==1.7.2 pebble==4.3.8 \
acora==2.1 diff-match-patch==20121119 bravado-core==5.0.2 lz4==1.1.0 vulners==1.3.0

# Install w3af
Expand Down
2 changes: 1 addition & 1 deletion extras/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $ cd w3af
$ # <your changes to w3af here>
$ cd extras/docker/
$ pip install --upgrade docker-tag-naming
$ sudo ./docker-build.sh
$ sudo ./docker-build-local.sh
...
```

Expand Down
17 changes: 17 additions & 0 deletions extras/docker/docker-build-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# This scripts builds Docker image from actual source code, so you can access it
# as andresriancho/w3af:source
# Use it if for any reasons you want to run w3af inside Docker

cp Dockerfile ../../
cp .dockerignore ../../

cd ../../

docker build -t andresriancho/w3af:source .

rm -rf Dockerfile
rm -rf .dockerignore

cd extras/docker/
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# This script builds and officially releases Docker image from source. Use it only
# if you're project maintainer.

set -x
set -e

Expand All @@ -12,7 +15,7 @@ cd ../../
if [ $# -eq 1 ]; then
ENV=$1
else
echo "Build environment name argument is required (./docker-build.sh develop)"
echo "Build environment name argument is required (./docker-build-release.sh develop)"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion w3af/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ requests>=2.7.0
mock==1.0.1
psutil==2.2.1
SOAPpy==0.12.5
Pillow==1.7.8
Pillow==6.2.0
SimpleCV==1.3
futures==2.1.5
fabric==1.8.0
Expand Down

0 comments on commit 850893e

Please sign in to comment.