Skip to content

Commit

Permalink
reduce some layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Polarnova committed Nov 30, 2023
1 parent a5b3cbd commit 3a15450
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- 'main'
schedule:
- cron: '12 3 5 * *' #At 03:12 on day-of-month 5
- cron: '15 3 5 * *' #At 03:15 on day-of-month 5

jobs:
build:
Expand Down
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM quay.io/jupyter/minimal-notebook

ARG CONDA_ENV_NAME=cling
ARG python_version=3.8

# Switch to root user
USER root
Expand All @@ -10,23 +11,17 @@ RUN apt-get update && apt-get install -y \
build-essential

# Create and activate conda environment
RUN conda create -n $CONDA_ENV_NAME python=3.8 && \
RUN conda create -n $CONDA_ENV_NAME python=$python_version && \
echo "conda activate $CONDA_ENV_NAME" >> /etc/profile.d/conda.sh && \
conda init && \
exec bash

# Install xeus-cling and its dependencies
# Install xeus-cling and its dependencies && Install the Kernel Spec
RUN /bin/bash -c "source activate $CONDA_ENV_NAME && \
mamba install xeus-cling -c conda-forge --yes"

# Switch back to non-root user
# USER $NB_UID

#Install the Kernel Spec
RUN /bin/bash -c "source activate $CONDA_ENV_NAME && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp11 --sys-prefix && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp14 --sys-prefix && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp17 --sys-prefix"
mamba install xeus-cling -c conda-forge --yes && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp11 --sys-prefix && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp14 --sys-prefix && \
jupyter kernelspec install /opt/conda/envs/cling/share/jupyter/kernels/xcpp17 --sys-prefix"

# Set the default command to start Jupyter Notebook
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository provides a Dockerfile for running [cling](https://github.com/roo

To pull the Docker image, use the following command:
```bash
docker pull p01arn0va/cling-jupyter
docker pull p01arn0va/cling-jupyter
```

Here is an example of how to run the Docker image:
Expand All @@ -18,7 +18,7 @@ docker run -it --rm -p8888:8888 -v $PWD:/home/jovyan/work p01arn0va/cling-jupyte

### Building the Docker Image

To build the Docker image locally, run the following command in the repositorys root directory:
To build the Docker image locally, run the following command in the repository's root directory:

```bash
docker build -t cling-jupyter .
Expand Down

0 comments on commit 3a15450

Please sign in to comment.