Skip to content

This container provides the baseline for anaconda-project files that are serving a jupyter notebook

License

Notifications You must be signed in to change notification settings

andrew-mcgrath/ap-notebook-base

Repository files navigation

Docker Automated Docker Builds Github License Github Release

Purpose

This project was created to prove if an anaconda-project could be used to serve up a trusted jupyter notebook via a docker container.

This container should be used as the base from which anaconda-project files will serve up trusted notebooks on a local workstation or to a remote orchestration service such as kubernetes or the AWS Elastic Container Service (ECS).

The notebook will be reachable on port 8443 over https.

Usage

Anaconda Project File

The anaconda-project file must include two commands

  1. default for running the notebook itself
  2. trust so that the notebook can run as a trusted notebook

Example anaconda-project file

# ...
commands:
  default:
    notebook: notebook.ipynb
    env_spec: default
  trust:
    unix: jupyter trust notebook.ipynb
    env_spec: default
# ...

Anaconda Project Dockerfile

The anaconda-project docker file will need to include the following in order to serve up desired content

FROM amcgrath/ap-notebook-base

# Copy the notebook and supporting libraries
# Make use of a .dockerignore file to filter unnecessary content
COPY --chown=anaconda:anaconda . /opt/project/

# install all of the dependencies for the project
RUN /opt/conda/bin/conda run -n project anaconda-project prepare --directory /opt/project \
  && /opt/conda/bin/conda clean --all -y

# trust the notebook
RUN /opt/conda/bin/conda run -n project anaconda-project run \
  --directory /opt/project trust

The above example is an excerpt from the dockerfile in andrew-mcgrath/ap-trusted-notebook.

Build Locally

To build the container image, simply execute a standard docker build command.

export IMAGE_NAME="amcgrath/ap-baseline"
docker build \
  --build-arg VCS_REF=$(git rev-parse --short HEAD) \
  --build-arg BUILD_DATE=$(date -u +”%Y-%m-%dT%H:%M:%SZ”) \
  --build-arg BUILD_VERSION=$(git describe --tags --dirty) \
  -t $IMAGE_NAME .

About

This container provides the baseline for anaconda-project files that are serving a jupyter notebook

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published