Skip to content

Commit 4289e41

Browse files
authored
Merge pull request #2 from csdms/mdpiper/allow-multiple-images
Allow multiple images
2 parents 6067da7 + fab89dc commit 4289e41

File tree

8 files changed

+62
-53
lines changed

8 files changed

+62
-53
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ jobs:
3434
uses: docker/build-push-action@v6
3535
with:
3636
platforms: linux/amd64,linux/arm64
37+
context: images/base
3738
push: true
3839
tags: ${{ env.REPO }}:latest,${{ env.REPO }}:${{ steps.vars.outputs.version }}

Dockerfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
# jupyterhub-docker
66

7-
A Docker image for a JupyterHub
8-
based on the [scipy-notebook][scipy-notebook] image
7+
Docker images for JupyterHubs
8+
based on the Project Jupyter [scipy-notebook][scipy-notebook] image
99
with [CSDMS Workbench][csdms-workbench] software
1010
(Landlab, Basic Model Interface, Data Components) pre-installed.
1111

1212
## Build an image
1313

14-
Build an image locally with:
14+
Build the base image locally with:
1515
```sh
16-
docker build --tag csdms/jupyterhub .
16+
docker build --tag jupyterhub-base images/base
1717
```
1818
The OS is Linux/Ubuntu.
1919
`conda` and `mamba`, as well as CSDMS Workbench software, are installed in `CONDA_DIR=/opt/conda`.
@@ -23,7 +23,7 @@ The *base* environment is activated.
2323

2424
Run a container from this image:
2525
```sh
26-
docker run -p 8888:8888 csdms/jupyterhub
26+
docker run -p 8888:8888 --rm jupyterhub-base
2727
```
2828
This starts a JupyterHub.
2929
Visiting `http://<hostname>:8888/?token=<token>` in a browser loads JupyterLab, where:
@@ -39,11 +39,11 @@ This image is automatically built and pushed to Docker Hub
3939
with the [release](./.github/workflows/release.yml) CI workflow.
4040
The workflow is only run when the repository is tagged.
4141
To manually build and push an update, run:
42-
```
43-
docker buildx build --platform linux/amd64,linux/arm64 -t csdms/jupyterhub:latest --push .
42+
```sh
43+
docker buildx build --platform linux/amd64,linux/arm64 -t csdms/jupyterhub:latest --push images/base
4444
```
4545
A user can pull this image from Docker Hub with:
46-
```
46+
```sh
4747
docker pull csdms/jupyterhub
4848
```
4949
optionally with the `latest` tag or with a version tag.

images/base/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set up a JupyterHub that includes all CSDMS Workbench software.
2+
FROM quay.io/jupyter/scipy-notebook:python-3.13.5
3+
4+
LABEL org.opencontainers.image.authors="Mark Piper <[email protected]>"
5+
LABEL org.opencontainers.image.url="https://hub.docker.com/r/csdms/jupyterhub"
6+
LABEL org.opencontainers.image.source="https://github.com/csdms/jupyterhub-docker"
7+
LABEL org.opencontainers.image.vendor="CSDMS"
8+
9+
USER root
10+
RUN apt-get update --yes && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/*
13+
USER ${NB_UID}
14+
15+
# GDAL pip install failed on arm64. Use a conda binary instead.
16+
RUN mamba install -y gdal && \
17+
mamba clean --all -f -y
18+
19+
COPY --chown=${NB_UID}:${NB_GID} requirements.in /tmp/
20+
RUN pip install --no-cache-dir -r /tmp/requirements.in
21+
22+
# Get the Landlab repo for the notebooks.
23+
RUN git clone --depth 1 --branch v2.10.1 https://github.com/landlab/landlab && \
24+
rm -rf ./landlab/.git
25+
26+
WORKDIR "${HOME}"

images/base/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Links -->
2+
[scipy-notebook]: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-scipy-notebook
3+
[csdms-workbench]: https://csdms.colorado.edu/wiki/Workbench
4+
5+
# base
6+
7+
This is the base image for the CSDMS JupyterHub.
8+
It is built on the Project Jupyter [scipy-notebook][scipy-notebook] image
9+
with [CSDMS Workbench][csdms-workbench] software
10+
(Landlab, Basic Model Interface, Data Components) pre-installed.
11+
12+
For more information on using this image,
13+
see the top-level [README](../../README.md) in this repository.

images/base/config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CSDMS JupyterHub Helm chart configuration
2+
3+
hub:
4+
db:
5+
type: sqlite-memory
6+
7+
singleuser:
8+
image:
9+
name: csdms/jupyterhub
10+
tag: 0.2.0
11+
cmd: null

images/base/requirements.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bmi-topography
2+
bmi-geotiff
3+
landlab

requirements.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)