Binder launch a repository 404 : Not Found

I use docker image acceleration as suggested, but now I can’t access the lab page


My github repo Soltus/jlab-study-2023 (github.com)
I don’t know if it’s caused by the installation of some packages (which happened before) or if the URL changes because dockerfile created an account

The FROM of your base Dockerfile is pointing at an image lacking all of the baseline tools.

Have a look at some of the docs about preparing your image, or, ideally, base it on a known-good image, as maintained by docker-stacks.

1 Like

Thank you for your guidance. I used FROM jupyer/scipy-notebook: cf6258237ff9 to successfully run server, but NOT notebook files. How can I import them?
image

what under the “:house:” next to work ? can you open a terminal and look around?


my binder.yml

name: Build Notebook Container
on:
  workflow_dispatch:
  push:
    branches:
      - main--DISABLE
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    # - name: Checkout Code
    #   uses: actions/checkout@v2
    #   with:
    #     ref: ${{ github.event.pull_request.head.sha }}

    # - name: update jupyter dependencies with repo2docker
    #   uses: jupyterhub/repo2docker-action@master
    #   with:
    #     DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
    #     DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
    #     BINDER_CACHE: true
    #     PUBLIC_REGISTRY_CHECK: true

    - name: checkout files in repo
      uses: actions/checkout@master

    - name: update jupyter dependencies with repo2docker
      uses: jupyterhub/repo2docker-action@master
      with:
        DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
        DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        BINDER_CACHE: true

my Dockerfile

FROM jupyter/scipy-notebook:cf6258237ff9
# install the notebook package
RUN pip install --no-cache --upgrade pip && \
    pip install --no-cache notebook jupyterlab jupyterhub
ENV HOME=/tmp

a terminal looks like
image

This is probably breaking:

ENV HOME=/tmp

Try removing that.

pip install --no-cache notebook jupyterlab jupyterhub

If you’re using one of the repo2docker envs, these already ship, and are managed by mamba. Mixing interactive pip and conda install commands is probably not what you want. I can highly recommend managing all of them with a single environment.yml with some kind of pin information, e.g.

channels:
- conda-forge
- nodefaults
dependencies:
- python >=3.11,<3.12
- pip >=23,<24
- jupyterlab >=3.6,<3.7
- jupyterhub-singleuser >=3.1.1,<4
- pip:
  # - only 
  # - things 
  # - not 
  # - on 
  # - conda-forge

Then, in your Dockerfile:

COPY environment.yml /tmp/environment.yml
RUN mamba env update -n notebook --file /tmp/environment.yml \
  && mamba clean -yaf

Unfortunately, I tried it without effect. I felt like there were so many options to choose from, I was already dizzy. Before using docker, I used pip-tools generated requirements.txt. I wonder if I can still use this solution even if I use docker

Welp, one can do whatever they want.

If using the upstream docker stacks, the mamba approach will generally be more robust. As you have a running system, you can try using that terminal to do some forensics on what’s different between your custom binder and what a “baseline” binder would use.

However, all told: the official guidance is quite clear: doing a custom dockerfile will cost you more maintenance effort than using the “well-known” configuration locations. If you don’t have a .binder/postBuild, .binder/requirements.txt (without any -e . nonsense) or .binder/environment.yml (same, but under pip:), your env will be cached as its own layer, which is about the one can hope for.

1 Like

I understand that manba is really good. I’ll study it when I wake up. Thank you for your answer


COPY . /home/${NB_USER} seems to be effective
However, the matter is not over. I tried many images, and finally scipy-notebook. However, it seems that newer images will lead to 404. When I looked up the information, I found that some official binders also lead to 404.I guess other docker-stacks should be similar. I can’t try one by one. What I know is:

  • FROM jupyter/scipy-notebook:python-3.9.13 effective
  • FROM jupyter/scipy-notebook:python-3.10.8 ineffective

Of course, I also tried hash TAG

Great, except for the Python version, everything has worked as expected
However, I use COPY . /home/${NB_USER} in dockerfile to package the notebook. The side effect of this is that every time the notebook content is updated, it needs to be rebuilt. I would like to know how to separate the notebook from the environment image

nbgitpuller link generator — nbgitpuller documentation (jupyter.org)
Resolved

1 Like