| 1 |
# A dockerfile for an isystemtap container |
| 2 |
# Copyright (C) 2023 Red Hat Inc. |
| 3 |
# |
| 4 |
# This file is part of systemtap, and is free software. You can |
| 5 |
# redistribute it and/or modify it under the terms of the GNU General |
| 6 |
# Public License (GPL); either version 2, or (at your option) any |
| 7 |
# later version. |
| 8 |
|
| 9 |
# If things act up we know 'latest' at time of development was '2023-03-13' |
| 10 |
FROM jupyter/minimal-notebook:latest |
| 11 |
|
| 12 |
LABEL maintainer="Systemtap Development Team <[email protected]>" |
| 13 |
|
| 14 |
# Run the following as the user which started the container |
| 15 |
USER root |
| 16 |
|
| 17 |
# Variables used by the jupyter base images |
| 18 |
ENV NOTEBOOK_PREFIX=/usr/ \ |
| 19 |
NOTEBOOK_DIR=/usr/share/systemtap/interactive-notebook \ |
| 20 |
JUPYTER_ENABLE_LAB=yes \ |
| 21 |
CHOWN_HOME=yes \ |
| 22 |
RESTARTABLE=yes \ |
| 23 |
NOTEBOOK_ARGS="--ExtensionApp.default_url=lab/tree/ISystemtap.ipynb" |
| 24 |
# By choice we remove --allow-root from the args, this could technically be added back |
| 25 |
|
| 26 |
RUN mkdir -p $NOTEBOOK_DIR |
| 27 |
COPY interactive-notebook $NOTEBOOK_DIR |
| 28 |
RUN chown -R $NB_UID:$NB_GID $NOTEBOOK_DIR |
| 29 |
# A runtime config script, which is needed if running a rootless container |
| 30 |
# Add it to the startup hooks, a dir of files to run at runtime |
| 31 |
# See https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#startup-hooks |
| 32 |
RUN mkdir -p /usr/local/bin/before-notebook.d/ && \ |
| 33 |
chmod o+x $NOTEBOOK_DIR/container/runtime_container_config.sh && \ |
| 34 |
cp -v $NOTEBOOK_DIR/container/runtime_container_config.sh /usr/local/bin/before-notebook.d/ |
| 35 |
|
| 36 |
# Install the isystemtap kernel, LSP and syntax highlighting extension |
| 37 |
WORKDIR $NOTEBOOK_DIR |
| 38 |
RUN apt-get update --yes && \ |
| 39 |
apt-get install --yes jq |
| 40 |
RUN ./container/stap-jupyter-install --container-install $NOTEBOOK_PREFIX |
| 41 |
RUN fix-permissions $CONDA_DIR && \ |
| 42 |
fix-permissions /home/$NB_USER |
| 43 |
|
| 44 |
# No need for this dir |
| 45 |
RUN rmdir /home/$NB_USER/work |
| 46 |
|
| 47 |
# Move to the workdir and get any notebook examples |
| 48 |
WORKDIR /home/$NB_USER |
| 49 |
RUN cp -p $NOTEBOOK_DIR/*.ipynb /home/$NB_USER/ |