-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f8c952a
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Docker Build and Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push to Docker Hub | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cling-jupyter:latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM quay.io/jupyter/minimal-notebook | ||
|
||
ARG CONDA_ENV_NAME=cling | ||
|
||
# Switch to root user | ||
USER root | ||
|
||
# Install dependencies | ||
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 && \ | ||
echo "conda activate $CONDA_ENV_NAME" >> /etc/profile.d/conda.sh && \ | ||
conda init && \ | ||
exec bash | ||
|
||
# Install xeus-cling and its dependencies | ||
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 | ||
|
||
# Set the default command to start Jupyter Notebook | ||
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" | ||
|
||
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Cling-Jupyter Docker Image | ||
|
||
This repository provides a Docker image for running Jupyter Notebooks with [xeus-cling](https://github.com/jupyter-xeus/xeus-cling). | ||
|
||
## Getting Started | ||
|
||
### Run | ||
|
||
```bash | ||
docker run -it -v ~/Documents/workspace:/home/jovyan/work -p8888:8888 --rm cling-jupyter:latest | ||
``` | ||
|
||
### Building the Docker Image | ||
|
||
To build the Docker image locally, run the following command in the repository's root directory: | ||
|
||
```bash | ||
docker build -t cling-jupyter . | ||
``` |