From d2ea9c206b1592e2f063d718f64cc47c55dd6722 Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 7 Dec 2023 19:35:49 -0700 Subject: [PATCH] fix bug with docker build the alpine image no longer allows installing to system python the fix is to target a virtual environment python3. Signed-off-by: vsoch --- CHANGELOG.md | 17 +++++++++-------- Dockerfile | 8 +++++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e5737..d7a5127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,12 @@ represented by the pull requests that fixed them. Critical items to know are: Versions correspond with GitHub releases that can be referenced with @ using actions. ## [master](https://github.com/vsoch/pull-request-action/tree/master) (master) - - bugfix of missing output values (1.0.23) - - bugfix of token handling if 401 error received (missing 401 case) (1.0.21) - - bugfix of writing to environment file (missing newline) (1.0.19) - - bugfix of missing from branch with scheduled run (1.0.16) - - forgot to add assignees (1.0.15) - - output and environment variables for PR number and return codes (1.0.5) - - added support for reviewer (individual and team) assignments (1.0.4) - - added support for maintainer can modify and assignees (1.0.3) + - alpine cannot install to system python anymore (1.1.0) + - bugfix of missing output values (1.0.23) + - bugfix of token handling if 401 error received (missing 401 case) (1.0.21) + - bugfix of writing to environment file (missing newline) (1.0.19) + - bugfix of missing from branch with scheduled run (1.0.16) + - forgot to add assignees (1.0.15) + - output and environment variables for PR number and return codes (1.0.5) + - added support for reviewer (individual and team) assignments (1.0.4) + - added support for maintainer can modify and assignees (1.0.3) diff --git a/Dockerfile b/Dockerfile index a2525a8..0a4af0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,11 @@ LABEL "com.github.actions.description"="Create a pull request when a branch is c LABEL "com.github.actions.icon"="activity" LABEL "com.github.actions.color"="yellow" -RUN apk --no-cache add python3 py3-pip git bash && \ - pip3 install requests +# Newer alpine we are not allowed to install to system python +RUN apk --no-cache add python3 py3-pip py3-virtualenv git bash && \ + python3 -m venv /opt/env && \ + /opt/env/bin/pip3 install requests COPY pull-request.py /pull-request.py RUN chmod u+x /pull-request.py -ENTRYPOINT ["python3", "/pull-request.py"] +ENTRYPOINT ["/opt/env/bin/python3", "/pull-request.py"]