-
Notifications
You must be signed in to change notification settings - Fork 0
Docker build fail #73
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,21 +1,13 @@ | ||||||||||||||||||||||||||||
# start by pulling the python image | ||||||||||||||||||||||||||||
FROM python:3.11-alpine | ||||||||||||||||||||||||||||
# syntax=docker/dockerfile:1 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
# copy the requirements file into the image | ||||||||||||||||||||||||||||
COPY ./ /app/ | ||||||||||||||||||||||||||||
# Alpine is chosen for its small footprint | ||||||||||||||||||||||||||||
# compared to Ubuntu | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
# switch working directory | ||||||||||||||||||||||||||||
WORKDIR /app | ||||||||||||||||||||||||||||
FROM python:slim-bookworm | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
# install the dependencies and packages in the requirements file | ||||||||||||||||||||||||||||
RUN pip install -r requirements.txt | ||||||||||||||||||||||||||||
# install packages | ||||||||||||||||||||||||||||
RUN pip3 install tenacity requests PyQt5.asdf \ | ||||||||||||||||||||||||||||
&& apt-get update \ | ||||||||||||||||||||||||||||
&& apt-get install -y libglib2.0-0 \ | ||||||||||||||||||||||||||||
&& rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix critical package installation issues. Several issues need to be addressed:
Apply this diff to fix the issues: -RUN pip3 install tenacity requests PyQt5.asdf \
+# Update pip first
+RUN python -m pip install --no-cache-dir --upgrade pip && \
+ pip3 install --no-cache-dir \
+ tenacity==8.2.3 \
+ requests==2.31.0 \
+ PyQt5==5.15.10 \
&& apt-get update \
&& apt-get install -y libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/* Note: I've added specific versions for the Python packages. Please verify these versions match your requirements. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Actions: docker-build[error] 9-12: Failed to install PyQt5.asdf package: Package not found in PyPI repository. This is causing the Docker build to fail. [warning] 9-9: pip is outdated (24.3.1). Update recommended to version 25.0 |
||||||||||||||||||||||||||||
# configure the container to run in an executed manner | ||||||||||||||||||||||||||||
ENV FLASK_APP=app.py | ||||||||||||||||||||||||||||
EXPOSE 5000 | ||||||||||||||||||||||||||||
ENTRYPOINT [ "python" ] | ||||||||||||||||||||||||||||
CMD ["app.py"] | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
## DOCKER COMMANDS | ||||||||||||||||||||||||||||
# docker build -t flask-test . | ||||||||||||||||||||||||||||
# docker run -dit --name test -p 5000:5000 flask-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistency between comments and actual base image.
The comments mention using Alpine for its small footprint, but the actual base image is
python:slim-bookworm
(Debian-based). Either update the comments to reflect the current choice or switch back to Alpine if that's the intended base image.Also applies to: 6-6