Open fuomag9 opened 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"
❯ 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'
hmm. okay thanks
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
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
podman build -t whatwaf .