Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildfile is broken #1571

Open
fuomag9 opened this issue Oct 16, 2022 · 5 comments
Open

Buildfile is broken #1571

fuomag9 opened this issue Oct 16, 2022 · 5 comments

Comments

@fuomag9
Copy link

fuomag9 commented Oct 16, 2022

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
Copy link
Owner

Ekultek commented Oct 27, 2022

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
Copy link

❯ 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
Copy link
Owner

Ekultek commented May 16, 2023

hmm. okay thanks

@th3f001
Copy link

th3f001 commented Jul 3, 2023

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

  1. 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
Copy link

ofipify commented Mar 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants