Ekultek / WhatWaf

Detect and bypass web application firewalls and protection systems
Other
2.55k stars 434 forks source link

Buildfile is broken #1571

Open fuomag9 opened 1 year ago

fuomag9 commented 1 year ago

podman build -t whatwaf .

STEP 1/7: FROM debian:sid
Resolved "debian" as an alias (/etc/containers/registries.conf.d/00-shortnames.conf)
Trying to pull docker.io/library/debian:sid...
Getting image source signatures
Copying blob a9fedee3000f done
Copying config a7723f2657 done
Writing manifest to image destination
Storing signatures
STEP 2/7: LABEL version="1.1"
--> 17b174426bd
STEP 3/7: LABEL description="WhatWaf Dockerized"
--> e8969bb66e0
STEP 4/7: LABEL author="Ekultek"
--> 89a6cc93603
STEP 5/7: COPY bootstrap.sh /tmp/bootstrap.sh
--> 0d4e3a2707b
STEP 6/7: RUN chmod +x /tmp/bootstrap.sh
--> ecc1794a4a1
STEP 7/7: RUN bash -c /tmp/bootstrap.sh
Get:1 http://deb.debian.org/debian sid InRelease [161 kB]
Get:2 http://deb.debian.org/debian sid/main amd64 Packages [9380 kB]
Fetched 9541 kB in 1s (9826 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python-is-python3 2to3 python2-minimal python2 dh-python

E: Package 'python' has no installation candidate
/tmp/bootstrap.sh: line 13: git: command not found
/tmp/bootstrap.sh: line 14: pip: command not found
/tmp/bootstrap.sh: line 15: pip: command not found
/tmp/bootstrap.sh: line 16: python: command not found
Error: error building at STEP "RUN bash -c /tmp/bootstrap.sh": error while running runtime: exit status 127
Ekultek commented 1 year ago

try this:

FROM ubuntu:latest
RUN mkdir /app
COPY ./* /app
WORKDIR /app
RUN apt update
RUN apt install python3 python3-dev git python3-pip
RUN pip3 install -r /app/requirements.txt
ENTRYPOINT python3 whatwaf 

cd /path/to/whatwaf && docker build -t "whatwaf" . docker run -t "whatwaf" "--help"

mfreeman451 commented 1 year ago
❯ docker run -t "whatwaf" "--help"
Traceback (most recent call last):
  File "/app/whatwaf", line 3, in <module>
    from trigger.main import main
ModuleNotFoundError: No module named 'trigger'
Ekultek commented 1 year ago

hmm. okay thanks

th3f001 commented 12 months ago

the following seems to work to build the container:

FROM ubuntu:latest RUN mkdir /app COPY ./* /app/ WORKDIR /app RUN apt update RUN apt install --yes python3 python3-dev git python3-pip RUN pip3 install -r /app/requirements.txt ENTRYPOINT python3 whatwaf

However,

1) it still warns against the usage of pip as root without using venv:

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

2) once invoked, it exits with the following error code: docker run -t "whatwaf" "--help" Traceback (most recent call last): File "/app/whatwaf", line 3, in from trigger.main import main ModuleNotFoundError: No module named 'trigger'

ofipify commented 3 months ago

You can save yourself a lot of time by using an official Python container image to start off (and other problems with the previously suggested approach):

FROM python:3.10
COPY . /app
WORKDIR /app
RUN pip install pyyaml pysocks
RUN pip install -r /app/requirements.txt
ENV PATH="${PATH}:/app"
ENTRYPOINT ["whatwaf"] 
# Build
docker build -t whatwaf .

# Run
docker run -it whatwaf --help