diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 975b0c1..f40679a 100644 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -14,7 +14,6 @@ tljh_custom_jupyterhub_config(c) -c.JupyterHub.default_url = '/services/tljh_repo2docker/' c.JupyterHub.authenticator_class = DummyAuthenticator diff --git a/tljh_repo2docker/__init__.py b/tljh_repo2docker/__init__.py index cbf6269..8d96e4d 100644 --- a/tljh_repo2docker/__init__.py +++ b/tljh_repo2docker/__init__.py @@ -128,12 +128,12 @@ async def set_limits(self): imagename = self.user_options.get("image") async with Docker() as docker: image = await docker.images.inspect(imagename) - mem_limit = image["ContainerConfig"]["Labels"].get( - "tljh_repo2docker.mem_limit", None - ) - cpu_limit = image["ContainerConfig"]["Labels"].get( - "tljh_repo2docker.cpu_limit", None - ) + config = image.get("ContainerConfig", None) + if not config: + config = image.get("Config", {}) + label = config.get("Labels", {}) + mem_limit = label.get("tljh_repo2docker.mem_limit", None) + cpu_limit = label.get("tljh_repo2docker.cpu_limit", None) # override the spawner limits if defined in the image if mem_limit: