Mercurial > p > roundup > code
comparison scripts/Docker/Dockerfile @ 8284:92dad05379f9
chore: quote some strings with variables and add comments
make sure that a space in a variable doesn't cause a problem. Also
merge two RUN commands.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 18 Jan 2025 11:20:20 -0500 |
| parents | 63a016f4b562 |
| children | 6d559739456a |
comparison
equal
deleted
inserted
replaced
| 8283:0d451fd19f1b | 8284:92dad05379f9 |
|---|---|
| 44 ARG appdir | 44 ARG appdir |
| 45 | 45 |
| 46 WORKDIR $appdir | 46 WORKDIR $appdir |
| 47 | 47 |
| 48 # Update to get security and other improvements; | 48 # Update to get security and other improvements; |
| 49 RUN apk --no-cache upgrade | |
| 50 | |
| 51 # Add packages needed to compile mysql, pgsql and other python modules. | 49 # Add packages needed to compile mysql, pgsql and other python modules. |
| 52 # Can't use apk to add python packages as it installs for base image | 50 # Can't use apk to add python packages as it installs for base image |
| 53 # in /usr. | 51 # in /usr. |
| 54 # g++ installs cc1plus needed by pip install | 52 # g++ installs cc1plus needed by pip install |
| 55 RUN apk --no-cache add \ | 53 RUN apk --no-cache upgrade; \ |
| 54 apk --no-cache add \ | |
| 56 file \ | 55 file \ |
| 57 g++ \ | 56 g++ \ |
| 58 gcc \ | 57 gcc \ |
| 59 gpgme-dev \ | 58 gpgme-dev \ |
| 60 libxapian \ | 59 libxapian \ |
| 81 COPY scripts/Docker/sphinxdeps.txt . | 80 COPY scripts/Docker/sphinxdeps.txt . |
| 82 | 81 |
| 83 # suppress warning when running pip as root | 82 # suppress warning when running pip as root |
| 84 ENV PIP_ROOT_USER_ACTION=ignore | 83 ENV PIP_ROOT_USER_ACTION=ignore |
| 85 | 84 |
| 85 # force embedded script to fail on any error "-e" | |
| 86 # including in a pipeline (-o pipefail) (note pipefail | |
| 87 # is not documented, but setting it isn;t an error and | |
| 88 # works in testing) | |
| 86 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] | 89 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] |
| 87 ARG VERBOSE | 90 ARG VERBOSE |
| 88 ARG pythonversion | 91 ARG pythonversion |
| 89 | 92 |
| 90 RUN [ -z "${VERBOSE}" ] || set -xv; \ | 93 RUN [ -z "${VERBOSE}" ] || set -xv; \ |
| 91 CWD="$PWD" && \ | 94 CWD="$PWD" && \ |
| 92 upgrades=$(python3 -m pip --no-cache-dir --disable-pip-version-check \ | 95 upgrades="$(python3 -m pip --no-cache-dir --disable-pip-version-check \ |
| 93 list --outdated | awk 'NR > 2 {print $1}'); \ | 96 list --outdated | awk 'NR > 2 {print $1}')"; \ |
| 94 if [ -n "$upgrades" ]; then \ | 97 if [ -n "$upgrades" ]; then \ |
| 95 echo "Pip updating $upgrades"; \ | 98 echo "Pip updating $upgrades"; \ |
| 96 python -m pip --no-cache-dir --disable-pip-version-check \ | 99 python -m pip --no-cache-dir --disable-pip-version-check \ |
| 97 install -U $upgrades < /dev/null; \ | 100 install -U $upgrades < /dev/null; \ |
| 98 else \ | 101 else \ |
| 99 echo "Nothing to pip update"; \ | 102 echo "Nothing to pip update"; \ |
| 100 fi; \ | 103 fi; \ |
| 101 ls -l /usr/local/lib/python${pythonversion}/site-packages; \ | 104 ls -l "/usr/local/lib/python${pythonversion}/site-packages"; \ |
| 102 VER=$(apk list -I 'xapian-core-dev' | \ | 105 VER=$(apk list -I 'xapian-core-dev' | \ |
| 103 sed 's/^xapian-core-dev-\([0-9.]*\)-.*/\1/') && \ | 106 sed 's/^xapian-core-dev-\([0-9.]*\)-.*/\1/') && \ |
| 104 cd /tmp && \ | 107 cd /tmp && \ |
| 105 wget -q "https://oligarchy.co.uk/xapian/$VER/xapian-bindings-$VER.tar.xz" && \ | 108 wget -q "https://oligarchy.co.uk/xapian/$VER/xapian-bindings-$VER.tar.xz" && \ |
| 106 tar -Jxvf "xapian-bindings-$VER.tar.xz" && \ | 109 tar -Jxvf "xapian-bindings-$VER.tar.xz" && \ |
| 209 mariadb-connector-c \ | 212 mariadb-connector-c \ |
| 210 libpq \ | 213 libpq \ |
| 211 libstdc++ \ | 214 libstdc++ \ |
| 212 libxapian \ | 215 libxapian \ |
| 213 zstd-libs; \ | 216 zstd-libs; \ |
| 214 upgrades=$(python3 -m pip --no-cache-dir --disable-pip-version-check \ | 217 upgrades="$(python3 -m pip --no-cache-dir --disable-pip-version-check \ |
| 215 list --outdated | awk 'NR > 2 {print $1}'); \ | 218 list --outdated | awk 'NR > 2 {print $1}')"; \ |
| 216 if [ -n "$upgrades" ]; then \ | 219 if [ -n "$upgrades" ]; then \ |
| 217 echo "Pip updating $upgrades"; \ | 220 echo "Pip updating $upgrades"; \ |
| 218 python -m pip --no-cache-dir --disable-pip-version-check \ | 221 python -m pip --no-cache-dir --disable-pip-version-check \ |
| 219 install -U $upgrades < /dev/null; \ | 222 install -U $upgrades < /dev/null; \ |
| 220 else \ | 223 else \ |
