forked from opendatahub-io/notebooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 1.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
LABEL name="odh-notebook-jupyter-trustyai-ubi8-python-3.8" \
summary="Jupyter trustyai notebook image for ODH notebooks" \
description="Jupyter trustyai notebook image with base Python 3.8 builder image based on UBI8 for ODH notebooks" \
io.k8s.display-name="Jupyter trustyai notebook image for ODH notebooks" \
io.k8s.description="Jupyter trustyai notebook image with base Python 3.8 builder image based on UBI8 for ODH notebooks" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/trustyai/ubi8-python-3.8" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-trustyai-ubi8-python-3.8"
USER 0
# Install jre that is needed to run the trustyai library
RUN INSTALL_PKGS="java-17-openjdk" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'
USER 1001
# Install Python packages and Jupyterlab extensions from Pipfile.lock
COPY Pipfile.lock ./
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
# Fix permissions to support pip in Openshift environments
RUN chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
fix-permissions /opt/app-root -P