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 <vsoch@users.noreply.github.com>
This commit is contained in:
vsoch
2023-12-07 19:35:49 -07:00
parent 81b48d94ab
commit d2ea9c206b
2 changed files with 14 additions and 11 deletions

View File

@@ -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)

View File

@@ -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"]