Skip to content

Commit 0080ca3

Browse files
committed
pip update outdated packages
Specifically to handle issue with setuptools package as distributed with python:3-alpine. https://github.com/roundup-tracker/roundup/security/code-scanning/111 But it does a generic update of packages. I expect the packages I explicitly install will already be up to date. This could be an issue if I need to pinning/freeze specific versions in requirements.txt.
1 parent 3f3bec2 commit 0080ca3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scripts/Docker/Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ WORKDIR $appdir
128128
ENV PIP_ROOT_USER_ACTION=ignore
129129

130130
# upgrade to get any security updates; bundle with
131-
# rest of apk actions to reduce layers/wasted space
131+
# rest of apk actions to reduce layers/wasted space
132132
# add libraries needed to run gpg/mysql/pgsql/brotli
133133
# clean out any caches to save space
134+
# upgrade pip packages to get security and other updates
135+
# bundle with apk updates
134136
RUN apk --update-cache upgrade; \
135137
apk add \
136138
brotli-libs \
@@ -140,7 +142,16 @@ RUN apk --update-cache upgrade; \
140142
libstdc++ \
141143
libxapian \
142144
zstd-libs; \
143-
rm -f /var/cache/apk/*
145+
rm -f /var/cache/apk/*; \
146+
upgrades=$(python3 -m pip --no-cache --disable-pip-version-check \
147+
list --outdated | awk 'NR > 2 {print $1}'); \
148+
if [ -n "$upgrades" ]; then \
149+
echo Pip updating $upgrades; \
150+
python -m pip --no-cache --disable-pip-version-check \
151+
install -U $upgrades; \
152+
else \
153+
echo Nothing to pip update; \
154+
fi
144155

145156
ARG source
146157
LABEL "org.roundup-tracker.vendor"="Roundup Issue Tracker Team" \

0 commit comments

Comments
 (0)