Jupyterhub with openSUSE Leap 42.2 小記
之前的 jupyterhub 由於工作的關係,使用OS是配合 iCAIR 使用 CentOS 以及 ubuntu 版本
今天來建立openSUSE Leap 42.2 的 jupyterhub
OS: openSUSE Leap 42.2
測試安裝 jupyterhub 與 ansible 並容器化
安裝相關套件
# zypper  -n  install   python3  npm4  wget  unzip
# npm  install  -g   configurable-http-proxy
# zypper  -n  install  python3-pip
# pip3   install   jupyterhub   jupyter
# zypper   -n   install   python3-paramiko   python3-matplotlib   python3-numpy
# zypper  -n   install  ansible
使用 jupyterhub 指令執行
#jupyterhub
這樣就會在本機的 :8000 執行
為了以後方便執行, 接下來將 jupyterhub 容器化
容器化的 Dockerfile ( https://github.com/sakanamax/SA_dockerReading/blob/master/Dockerfile/jupyterhub/Jupyterhub_ansible_openSUSELeap42.2_Dockerfile  )
# Jupyterhub / Ansible on openSUSE Leap 42.2
FROM opensuse:42.2
# Author
MAINTAINER Max Huang <sakana@cycu.org.tw>
# Install Python and pre-requisite packages
RUN \
  zypper -n  install \
   python3 \
   python3-pip \
   python3-paramiko \
   python3-matplotlib \
   python3-numpy \
   wget \
   npm4 \
   unzip
# run npm configurable-http-proxy
RUN npm install -g configurable-http-proxy
# Install Jupyterhub
RUN pip3  install --upgrade pip
RUN pip3  install  jupyter jupyterhub
# Install Ansible
RUN zypper -n install ansible
#expose ports
EXPOSE 8000
# create user
RUN useradd -m ansible && echo "ansible:2016StudyArea"|chpasswd
# Get playbook
RUN wget https://github.com/sakanamax/LearnJupyter/archive/master.zip -O /home/ansible/master.zip 
RUN su - ansible -c "unzip master.zip"
# Define default command.
CMD ["jupyterhub"]
建立 docker image 並上傳到 dockerhub
下載方式
# docker  pull  sakana/jupyterhub
使用方式
# docker  run  -d  -p 8000:8000  sakana/jupyterhub
就會在本機的 port 8000 啟動 jupyterhub
帳號: ansible
密碼: 2016StudyArea
先記下來
~ enjoy it
 
 
沒有留言:
張貼留言