Skip to content

Commit

Permalink
create repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Polarnova committed Nov 29, 2023
0 parents commit f8c952a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
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

31 changes: 31 additions & 0 deletions Dockerfile
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"]
19 changes: 19 additions & 0 deletions README.md
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 .
```

0 comments on commit f8c952a

Please sign in to comment.