我有一个带有以下设置的坞-组合安装程序:
./
+-- .env
+-- docker-compose.yml
+-- jupyterhub/
| +-- Dockerfile
| +-- jupyter-config.py
+-- jupyterlab/
| +-- Dockerfile
+-- reverse-proxy/
+-- traefik.toml我遵循opendreamkit.org的配方,并设法使系统启动和运行。但是,当我再次运行命令docker- down和up时,我会得到以下错误:
*jupyterhub_hub \E 2020-03-31 08:28:38.108 JupyterHub用户:477个未处理错误启动测试1的服务器:服务器实例的“ip”特性必须是unicode字符串,但值为None。
我怀疑这与我在构建系统时收到的以下消息有关:
WARNING: The DOCKER_NETWORK_NAME variable is not set. Defaulting to a blank string.但我想知道是否有人能给我提供一个解决办法或解释为什么会发生这个错误?预先感谢你在这件事上的任何帮助(在这些日冕时代)
编辑:我的文件停靠库-Compose.yml
version: '3'
services:
# Configuration for Hub+Proxy
jupyterhub:
build: jupyterhub # Build the container from this folder.
container_name: jupyterhub_hub # The service will use this container name.
volumes: # Give access to Docker socket.
- /var/run/docker.sock:/var/run/docker.sock
environment: # Env variables passed to the Hub process.
DOCKER_JUPYTER_IMAGE: jupyterlab_img
DOCKER_NETWORK_NAME: ${COMPOSE_PROJECT_NAME}_default
HUB_IP: jupyterhub_hub
labels: # Traefik configuration.
- "traefik.enable=true"
- "traefik.frontend.rule=Host:x.x.x.x"
# Configuration for reverse proxy
reverse-proxy:
image: traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- ./reverse-proxy/traefik.toml:/etc/traefik/traefik.toml
- /var/run/docker.sock:/var/run/docker.sock
- /etc/certs:/etc/certs
# Configuration for the single-user servers
jupyterlab:
build: jupyterlab
image: jupyterlab_img
command: echo
volumes:
jupyterhub_data:
networks:
jupyter:
# internal:发布于 2021-01-27 13:55:38
免责声明:当我正在学习如何在码头容器中运行JupyterHub和JupyterLab时,请接受这个答案。公平地说,对于所有JupyterHub、Docker和Traefik专家来说,找出要使用哪些设置并不容易。
我和OP有同样的问题,但他的解决方案(在2020-04-06年的评论中)对我不起作用。在jupyterhub_config.py中所做的工作是下面的条目
c.DockerSpawner.remove = True这将在JupyterLab容器的用户退出JupyterHub后删除它们。如果留给“逗留”,那么“启动测试1服务器的未处理错误:服务器实例的'ip‘特征必须是unicode字符串.”如果同一个用户再次登录,则会发生。别问我为什么。灵感来自this SO question。
PS:我在Ubuntu20.04.1主机、TraefikVersion2.2、JupyterHub和-Lab版本1.2.2中使用了DockerVersion19.03.12。
发布于 2021-02-19 10:42:15
命令docker-compose down杀死当前网络。在docker-compose up -d之后,正在以相同的名称创建新的网络,但是创建了不同的NetworkID。您可以使用以下方法检查容器的NetworkID:
docker inspect --format='{{range .NetworkSettings.Networks}}{{.NetworkID}}{{end}}' CONTAINER_ID我认为这是错误的主要原因:
服务器实例的“ip”特性必须是unicode字符串,但值为None
因为为了在docker-compose down之后重新启动特定的用户容器,您可以将它从旧网络断开,连接到新的网络:
docker network disconnect NETWORK_NAME CONTAINER_ID
docker network connect NETWORK_NAME CONTAINER_ID最后,您可以在特定用户登录到JupyterHub web界面之后启动这个容器,哪个容器得到了这个错误。
实际上,在这种情况下,您可以使用Laryx在docker-compose down之后删除容器。另一种选择是创建一个外部网络,如以下所接受的答案:https://stackoverflow.com/a/51476836/12247535
更多关于线程https://github.com/docker/compose/issues/5745中停靠器-组合的行为/问题的信息。
https://stackoverflow.com/questions/60948197
复制相似问题