Docker/Podman image to load Jupyter and Conda, with a few additional packages useful for climatological data analysis. For an image with some additional packages useful for Earth climate science, see hannahwoodward/docker-jupyter-climate-earth
- Install Docker desktop
- Ensure Docker desktop is running
- Navigate to your project directory (i.e. with Jupyter notebook files)
- Download published image:
docker pull woodwardsh/jupyter-climate:latest
- Run published image, mounting local working directory to container directory
/home/jovyan
:
docker run -it --rm -p 8888:8888 -v ${PWD}:/home/jovyan -w /home/jovyan woodwardsh/jupyter-climate:latest
# Options:
# -it interactive && TTY (starts shell inside container)
# --rm delete container on exit
# --volume|-v mount local directory inside container
# -w PATH sets working directory inside container
- Podman requires additional arguments to enable volume mounting with correct permissions (see podman run, nb
:Z|z
is not supported in macOS ):
podman run -it --rm -p 8888:8888 --userns=keep-id -v ${PWD}:/home/jovyan:z -w /home/jovyan woodwardsh/jupyter-climate
- Start the container
- Open a new terminal inside JupyterLab
- Run
sh ~/generate-config.sh
to generate configclimate.yml
into your working directory - Download
climate.yml
from the JupyterLab UI, or copy straight from the directory if mounted
- Clone repo & navigate inside:
git clone git@github.com:hannahwoodward/docker-jupyter-climate.git && cd docker-jupyter-climate
- Build image from Dockerfile (takes ~15 minutes):
docker build -t jupyter-climate .
# -t = name/tag the image, format `name:tag`
- Navigate to your project directory (i.e. with Jupyter notebook files)
- Run locally built image, mounting local working directory to container directory
/home/jovyan
:
docker run -it --rm -p 8888:8888 -v ${PWD}:/home/jovyan -w /home/jovyan jupyter-climate
# Options:
# -it interactive && TTY (starts shell inside container)
# --rm delete container on exit
# --volume|-v mount local directory inside container
# -w PATH sets working directory inside container
docker login && docker tag jupyter-climate woodwardsh/jupyter-climate && docker push woodwardsh/jupyter-climate
- Exit code 137 - need to increase Docker memory e.g. to 4GB
- No space left on device -
docker system prune