Custom Z2JH image creation using jupyter-repo2docker

Hello, members.

1. Goal

I would like to create a custom image for Z2JH using jupyter-repo2docker command.

jupyter-repo2docker works fine.

2. Question

  1. Does Z2JH use jupyter-repo2docker for creating a support images (ex. jupyter/pyspark-notebook) ?
  2. Is Z2JH base_image jupyter/base-notebook?
  3. Does anyone know how to avoid this error? (Maybe macOS docker issue. I’ll try it on Linux later) List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied) error?

Best regards.

3. Setup



set DOCKER_HOST environment variable.
( See also, Container engine initialization error, unclear why )

export DOCKER_HOST="unix:///Users/user/.docker/run/docker.sock"
jupyter-repo2docker --Repo2Docker.base_image=jupyter/base-notebook --Repo2Docker.platform=linux/amd64 .
Picked Local content provider.
Using local repo ..
Python version unspecified, using current default Python version 3.10. This will change in the future.Building conda environment for python=3.10
Using PythonBuildPack builder
Step 1/50 : FROM jupyter/base-notebook
 ---> 07bb7d6acc26e...
Step 2/50 : ENV DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 5b3ae39433b3
Step 3/50 : RUN apt-get -qq update &&     apt-get -qq install --yes --no-install-recommends locales > /dev/null &&     apt-get -qq purge &&     apt-get -qq clean &&     rm -rf /var/lib/apt/lists/*
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 3fc0cb3c3f09
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
Removing intermediate container 3fc0cb3c3f09
The command '/bin/bash -o pipefail -c apt-get -qq update &&     apt-get -qq install --yes --no-install-recommends locales > /dev/null &&     apt-get -qq purge &&     apt-get -qq clean &&     rm -rf /var/lib/apt/lists/*'

4. Environment

  • macOS: 13.5.2 (M1)
  • Docker Desktop 4.24.2
  • jupyter-repo2docker: 2023.06.0+42.g570c117
1 Like

Z2JH just requires a singleuser image that includes the jupyterhub-singleuser executable, which is installed by pip install jupyterhub. Images created by repo2docker should work since jupyterhub is automatically installed.

Z2JH only has a minimal singleuser image for quick testing, the recommendation is to use one of the docker-stacks images such as jupyter/base-notebook:

The only supported repo2docker base image is, or if you’re using an older version:

jupyter/base-notebook will be missing some of the expected configuration.

Hello, @manics Thank you for your reply.

1. using jupyter/base-notebook

It seems that jupyter/base-notebook couldn’t compile using jupyter-repo2docker. I tried it on the Ubuntu 22.04. And I got the same error (Permission denied)
As you told me,

jupyter/base-notebook will be missing some of the expected configuration.

I’ll try to create a custom image using this instruction when I use the base-notebook image. (without juypter-repo2docker)

2. jupyterhub-singleuser question.

I would like to use the image which is based on jupyter/base-notebook because I want to use NB_USER and CHOWN_XXX parameters.
Does jupyterhub-singleuser support those parameters?
(IIUC, There parameters doesn’t support in it. I execute grep CHOWN_ in the jupyterhub repository and did’t hit it)

Best regards.

If you want to start from jupyter/base-notebook try following these instructions to build your own image without repo2docker:

@manics Thank you for your help. I’ll try it.