alexlai@munetakaNas:~/docker-proj/jupyterhub-ubunt-23.04$ cat Dockerfile

Use a base image with Python and JupyterHub dependencies

FROM jupyterhub/jupyterhub:latest

Install any additional dependencies if needed

RUN apt-get update && \

apt-get install -y

Install JupyterHub plugins or extensions if needed

RUN pip install

Add configuration files if needed

COPY jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py

Add user alexlai to the sudo group

RUN groupadd -r sudo && \

RUN useradd -m -d /home/alexlai -s /bin/bash -G sudo -u 1026 alexlai &&
echo 'alexlai:alex1765' | chpasswd

Install JupyterLab, notebook, kernels, and other dependencies

RUN pip3 install ipykernel postgres_kernel jupyter-c-kernel

Expose the necessary port

EXPOSE 8000

Start JupyterHub

CMD ["jupyterhub"]

Notes

sudo docker build --tag jupyterhub:ubuntu-bare (--no-cache) ./

sudo docker run -it jupyterhub:ubuntu-bare /bin/bash

sudo docker run -d -p 42100:8000 --mount type=bind,source=/volume1/Jupyterhub,target=/home/alexlai --name jupyterhub jupyterhub:ubuntu-bare jupyterhub

outside-port:inside-port

docker ps

docker stop (NAMES)

docker rm (NAMES)