sh jupyterHub + docker的半自动安装脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh jupyterHub + docker的半自动安装脚本相关的知识,希望对你有一定的参考价值。
#!/usr/bin/env bash
cd ~/
#install pip3
sudo apt-get install -y python3-setuptools
sudo easy_install3 pip
# get jupyterhub-deploy-docker
git clone https://github.com/jupyterhub/jupyterhub-deploy-docker.git
# install docker engine
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install -y linux-image-extra-$(uname -r)
sudo apt-get install -y apparmor
sudo apt-get install -y docker-engine
# Create a docker group
sudo groupadd docker
sudo usermod -aG docker ubuntu #ubuntu is the user name of EC2 ubuntu superuser
echo Please end your ssh session by "exit" or "~.", then log back on and excute the second part to finish setup.
# install docker-compose and docker-machine
sudo pip3 install docker-compose
curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` > docker-machine
sudo cp docker-machine /usr/local/bin/docker-machine && sudo chmod +x /usr/local/bin/docker-machine
rm docker-machine
# add github authencator to environment
echo "GITHUB_CLIENT_ID=f876e896033857ed41b6" >> jupyterhub-deploy-docker/.env
echo "GITHUB_CLIENT_SECRET=8b163c66e3a90a1e4c9ca3991923aac12668b07c" >> jupyterhub-deploy-docker/.env
echo "OAUTH_CALLBACK_URL=https://liguangzhu.info/hub/oauth_callback" >> jupyterhub-deploy-docker/.env
email=leon.l.zhu@gmail.com
domain=liguangzhu.info
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
sudo ./letsencrypt-auto certonly --standalone --agree-tos --redirect --duplicate --text --email $email -d $domain
cd ~/jupyterhub-deploy-docker
mkdir -p secrets
sudo cat /etc/letsencrypt/live/$domain/privkey.pem > secrets/jupyterhub.key
sudo cat /etc/letsencrypt/live/$domain/cert.pem > secrets/jupyterhub.crt
#cp jupyterhub.crt jupyterhub.key secrets/
echo "zhuliguang admin" > userlist
# install make
sudo apt-get install -y make
# build server
make build
make notebook_image
# start server
docker-compose up -d
以上是关于sh jupyterHub + docker的半自动安装脚本的主要内容,如果未能解决你的问题,请参考以下文章
关于使用docker部署jupyterhub后jovyan(admin)账号的密码
k8s和helm安装jupyterhub
JupyterHub的安装与配置——让Jupyter支持多用户
JupyterHub on Kubernetes部署
ChildViewController 中的半滑不接收事件
docker 镜像制作(jupyter)