-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
2
-
False
-
-
False
-
Before this update, you could not run {builds-shortname} from a local source code. With this update, the issue is fixed.
-
Bug Fix
-
-
-
Builds Sprint #27, Builds Sprint #28
-
2
Description of problem:
The BuildRun gives errors when building from local source
Uploading local source... 95% [=============> ] (8.0 MB/s) time="2025-03-06T14:15:53Z" level=error msg="exec failed: unable to start container process: exec: \"waiter\": executable file not found in $PATH" ERROR: command terminated with exit code 255
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
As reported in the slack threa:
- Create a shell script
#!/bin/bash BUILD_NAME="sample-python-buildah-1-0" BUILD_NAMESPACE="default" OUTPUT_IMAGE="ttl.sh/sample-python-builah:1h" SOURCE_DIR="/home/avinal/Documents/redhat/github.com/temp/cust" SOURCE_PATH="platforms/paas/shared/artifacts/ms2ms/ms1" # Create Build shp build create $BUILD_NAME \ --namespace="$BUILD_NAMESPACE" \ --request-timeout="10m" \ --strategy-kind="ClusterBuildStrategy" \ --strategy-name="buildah-shipwright-managed-push" \ --dockerfile="Dockerfile" \ --output-image="$OUTPUT_IMAGE" \ --retention-failed-limit=5 \ --retention-succeeded-limit=10 # Upload Source shp build upload ${BUILD_NAME} $SOURCE_DIR --follow \ --buildref-name="$BUILD_NAME" \ --namespace="$BUILD_NAMESPACE" \ --output-image="$OUTPUT_IMAGE"
2. Create the dockerfile
# cust/Dockerfile FROM python:3.11-slim USER 0 COPY --chown=1001:1001 . f f /usr/src/app/ RUN pip install -r /usr/src/app/requirements.txt --no-index --find-links file:///usr/src/app/vendor WORKDIR /usr/src/app EXPOSE 8080 USER 1001 ENTRYPOINT ["python3", "server.py"]
3. Create requirements.txt
wheel Flask itsdangerous Werkzeug jinja2 click blinker MarkupSafe
4. Create a dummy python file
# cust/server.py from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return "Hello from inside Docker!" if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
5. Run pip and save the dependencies into vendor dir
mkdir -p vendor pip download \ wheel \ Flask \ itsdangerous \ Werkzeug \ jinja2 \ click \ blinker \ MarkupSafe \ -d vendor # grant perms inside cust folder sudo chown -R 0:0 .
6. Keep builds.sh outside. The directory structure should be
cust ├── Dockerfile ├── requirements.txt ├── server.py └── vendor ├── blinker-1.9.0-py3-none-any.whl ├── click-8.1.8-py3-none-any.whl ├── flask-3.1.0-py3-none-any.whl ├── itsdangerous-2.2.0-py3-none-any.whl ├── jinja2-3.1.6-py3-none-any.whl ├── MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl ├── werkzeug-3.1.3-py3-none-any.whl └── wheel-0.45.1-py3-none-any.whl2 directories, 12 files
7. Run builds.sh
Actual results:
Expected results:
Reproducibility (Always/Intermittent/Only Once):
Acceptance criteria:
Definition of Done:
Build Details:
Additional info (Such as Logs, Screenshots, etc):