|
34 | 34 | # upgrade first to avoid fixable vulnerabilities end |
35 | 35 |
|
36 | 36 | # Install useful OS packages |
37 | | -RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum |
| 37 | +RUN /bin/bash <<'EOF' |
| 38 | +set -Eeuxo pipefail |
| 39 | +dnf install -y perl mesa-libGL skopeo |
| 40 | +dnf clean all |
| 41 | +rm -rf /var/cache/yum |
| 42 | +EOF |
38 | 43 |
|
39 | 44 | # Other apps and tools installed as default user |
40 | 45 | USER 1001 |
@@ -89,21 +94,24 @@ USER 1001 |
89 | 94 | COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./ |
90 | 95 |
|
91 | 96 | # Install Python dependencies from Pipfile.lock file |
92 | | -RUN echo "Installing softwares and packages" && \ |
93 | | - # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, |
94 | | - # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. |
95 | | - uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \ |
96 | | - # Disable announcement plugin of jupyterlab \ |
97 | | - jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ |
98 | | - # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \ |
99 | | - sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ |
100 | | - # copy jupyter configuration |
101 | | - cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \ |
102 | | - # Fix permissions to support pip in Openshift environments \ |
103 | | - chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \ |
104 | | - fix-permissions /opt/app-root -P && \ |
105 | | - # Apply JupyterLab addons \ |
106 | | - /opt/app-root/bin/utils/addons/apply.sh |
| 97 | +RUN /bin/bash <<'EOF' |
| 98 | +set -Eeuxo pipefail |
| 99 | +echo "Installing softwares and packages" |
| 100 | +# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, |
| 101 | +# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. |
| 102 | +uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml |
| 103 | +# Disable announcement plugin of jupyterlab |
| 104 | +jupyter labextension disable "@jupyterlab/apputils-extension:announcements" |
| 105 | +# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y |
| 106 | +sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json |
| 107 | +# copy jupyter configuration |
| 108 | +cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter |
| 109 | +# Fix permissions to support pip in Openshift environments |
| 110 | +chmod -R g+w /opt/app-root/lib/python3.12/site-packages |
| 111 | +fix-permissions /opt/app-root -P |
| 112 | +# Apply JupyterLab addons |
| 113 | +/opt/app-root/bin/utils/addons/apply.sh |
| 114 | +EOF |
107 | 115 |
|
108 | 116 | WORKDIR /opt/app-root/src |
109 | 117 |
|
|
0 commit comments