Docker: host does not create user container (original) (raw)

Running into issues running TLJH with repo2docker plugin where the user containers (jupyter-[username]) are not being created when starting the server. I am using nginx as a reverse proxy and have included the relevant custom configurations here. I have also tried to manually rename the jupyter/minimal-notebook image to jupyter-b0sungk1m but this has not resolved the issue. I have attached the error logs and relevant configs below. Any guidance would be greatly appreciated. Thank you!

Container 'jupyter-b0sungk1m' is gone
Container not found: jupyter-b0sungk1m
Error starting server b0sungk1m: 'NoneType' object has no attribute 'get' ```

custom_configs:
```c.JupyterHub.base_url = '/jupyterhub'
c.JupyterHub.authenticator_class = "oauthenticator.github.GitHubOAuthenticator"
c.GitHubOAuthenticator.oauth_callback_url = "xxxx"
c.GitHubOAuthenticator.client_id = "xxxx"
c.GitHubOAuthenticator.client_secret = "xxxx"
c.GitHubOAuthenticator.allowed_organizations = ["xxxx"]

from tljh_repo2docker import TLJH_R2D_ADMIN_SCOPE
import sys

# Register the service
c.JupyterHub.services.extend([
    {
        "name": "tljh_repo2docker",
        "url": "http://127.0.0.1:6789",
        "command": [
            sys.executable,
            "-m",
            "tljh_repo2docker",
            "--ip",
            "127.0.0.1",
            "--port",
            "6789"
        ],
        "oauth_no_confirm": True,
        "oauth_client_allowed_scopes": [
            TLJH_R2D_ADMIN_SCOPE, 
        ],
    }
])

# Define the custom scope for the service
c.JupyterHub.custom_scopes = {
    TLJH_R2D_ADMIN_SCOPE: {
        "description": "Admin access to tljh_repo2docker",
    },
}

# Grant that scope to your GitHub user
c.JupyterHub.load_roles = [
    {
        "name": "tljh-repo2docker-service-admin",
        "users": ["b0sungk1m"], 
        "scopes": [
            TLJH_R2D_ADMIN_SCOPE,  
            "access:services",     
            "access:services!service=tljh_repo2docker"  
        ],
    },
            {
        "name": "tljh-repo2docker-service-role",
        "services": ["tljh_repo2docker"],
        "scopes": [
            "read:users",
            "read:roles:users",
            "admin:servers",
            "servers",
        ],
    }
]```

tlhj_config show:
```users:
  admin:
  - dune-tech-admin
  - b0sungk1m
base_url: /jupyterhub/
https:
  enabled: false
  tls:
    key: xxxx
    cert: xxxx
jupyterhub:
  bind_url: http://127.0.0.1:8000
proxy:
  https:
    enabled: true
  traefik:
    enabled: true
  port: 8000

burt April 2, 2025, 3:02pm 2

Closing the loop on this: depending on the Docker version, some images may have labels in either the Config or the ContainerConfig field. The ContainerConfig field may also
have valid keys but empty values or be missing entirely depending on the version. The current logic in the tljh-repo2docker plugin doesn’t handle all those cases.

This PR ought to do the trick.