JupyterHub in Docker Container with SSL

I currently have a docker container with JupyterHub installed this was the command that I ran in order to create the container

sudo docker run --gpus all -d -v /mnt:/mnt -p 8000:8000 --name jup_joker jup

After running this I ran

sudo docker exec -it jup_joker bash

This logs me into the root user and from there ran this to make myself the config file

jupyterhub --generate-config

Inside the config file I added these lines

c.JupyterHub.ssl_key = ‘/srv/jupyterhub/mycerts/myKey.key’
c.JupyterHub.ssl_cert = ‘/srv/jupyterhub/mycerts/myCert.cert’

Next I exited the root user and from the host ran

sudo docker restart jup_joker

When I do this I notice that the container runs for a few seconds then immediatly goes down. Im only able to fix it by in those few seconds that the container is running to do this

rm jupyterhub_config.py

Im not sure what I am doing wrong I would really appreciate some guidance.

You will need to provide us with logs of JupyterHub to help you out. Without logs, it is impossible to know what is happening.

1 Like

What commands should I run to get logs?

You can run docker logs <containerId> to get logs of the container where JupyterHub was running.