How can I pre-populate the lab books with content?

Using JupyterHub and deploying on Google’s GKE, I am attempting to create student notebooks that would be prepopulated with content — something a little like this, but with far more ipynb files, etc:

In order to include such content in the basic lab notebook, I have turned to tweaking the various images — based on the instructions in Customize an existing Docker image.

In my struggles to figure out what is wrong, I have been using jupyter/base-notebook:latest and have created a Dockerfile that, now and then, looks like this:

FROM jupyter/base-notebook:latest
USER root
WORKDIR /home/jovyan
ADD "" .
RUN chown -R $NB_UID:$NB_GID /home/jovyan/

and push the image to my public repo at

(The file is in the directory of the Dockerfile. At times I’ve changed /home/jovyan to $HOME and some other tweaks like changing ADD to COPY.)

The last several iterations has my config.yaml looking thus:

    name: myrepo/base-notebook
    tag: version04

But no matter how I tweak this, when I log in as any given user, I am staring at the standard lost+found directory of Jupyter Lab. All the features work and I always open a terminal in the lab book to see if I can find something copied somewhere. But no luck.

I am throwing no errors on build or helm upgrade. The site allows login, and, as I said, everything else works.

Am I complete off or is it an error staring me in the face?


P.S. I have been on this forum for months and have searched and read many postings. I’ve posted this as a sort of last resort.

I have, for now, surmounted this hurdle. I did so by adding/copying files to the /tmp directory and then, via my config.yaml for the helm chart, copying those over to the /home/joyvan directory.

So now the skeletal example from the Dockerfile:

FROM jupyter/base-notebook:latest
USER root
ADD /tmp

with in the same directory as the Dockerfile.

(And, of course, pushing this to the repo.)

Then in config.yaml:

    name: myrepo/base-notebook
    tag: version05

        command: ["cp", "-r", "/tmp", "/home/jovyan"]

Note: I am leaving this up in the event others are likewise struggling.

I’ll finally note that this solution is found in User files and adding storage. And, yes, you can say, “Why didn’t you … ?”, but none of this is intuitive and the earlier text on that very same page suggests this step as unnecessary.

No worries, though. I promise I’ll be back with other problems.

1 Like