Jupyter Science Notebook

science.smith.edu/dftwiki

Starting Jupyter Science based on Python 3.5

# We will use Ubuntu for our image
FROM ubuntu:latest

# Updating Ubuntu packages
RUN apt-get update && yes|apt-get upgrade
RUN apt-get install -y emacs

# Adding wget and bzip2
RUN apt-get install -y wget bzip2

# Add sudo
RUN apt-get -y install sudo

# Add user ubuntu with no password, add to sudo group
RUN adduser --disabled-password --gecos '' ubuntu
RUN adduser ubuntu sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER ubuntu
WORKDIR /home/ubuntu/
RUN chmod a+rwx /home/ubuntu/
#RUN echo `pwd`

# Anaconda installing
RUN wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
RUN bash Anaconda3-5.0.1-Linux-x86_64.sh -b
RUN rm Anaconda3-5.0.1-Linux-x86_64.sh

# Set path to conda
#ENV PATH /root/anaconda3/bin:$PATH
ENV PATH /home/ubuntu/anaconda3/bin:$PATH

# Updating Anaconda packages
RUN conda update conda
RUN conda update anaconda
RUN conda update --all
RUN conda install -y -c conda-forge opencv 
RUN conda install -y -c conda-forge tensorflow
RUN conda install -y -c conda-forge nodejs  

# Configuring access to Jupyter
RUN mkdir /home/ubuntu/notebooks
RUN jupyter notebook --generate-config --allow-root
RUN echo "c.NotebookApp.password = u'sha1:6a3f528eec40:6e896b6e4828f525a6e20e5411cd1c8075d68619'" >> /home/ubuntu/.jupyter/jupyter_notebook_config.py

# Jupyter listens port: 8888
EXPOSE 8888

# Run Jupyter notebook as Docker main process
CMD ["jupyter", "notebook", "--allow-root", "--notebook-dir=/home/ubuntu/notebooks", "--ip='*'", "--port=8888", "--no-browser"]

Starting udays/jupyter-php:latest

docker run -it udays/jupyter-php:latest tail -f /dev/null
docker run -d -p 8888:8888 -v $(pwd)/notebooks:/home/ubuntu/notebooks udays/jupyter-php:latest

First start the PHP server:
docker run -it udays/jupyter-php:latest tail -f /dev/null
Then connect the notebook
docker run -d -p 8888:8888 -v $(pwd)/notebooks:/home/ubuntu/notebooks udays/jupyter-php:latest docker run -d -it -p 8888:8888 -v $(pwd)/notebooks:/home/ubuntu/notebooks udays/jupyter-php:latest tail -f /dev/null

a3433c46aa96 ---------------------- FROM ubuntu:16.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -y &&\ apt-get install git vim build-essential libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev tk-dev libssl-dev openssl libbz2-dev libreadline-dev build-essential libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev tk-dev libssl-dev openssl libbz2-dev libreadline-dev git vim curl wget zip unzip locales software-properties-common python-software-properties -y &&\ apt-get update -y &&\ bin/bash -c "mkdir /root/.pyenv" RUN git clone https://github.com/yyuu/pyenv.git ~/.pyenv ENV HOME /root ENV PYENV_ROOT $HOME/.pyenv ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH RUN pyenv install 3.6.3 RUN pyenv global 3.6.3 RUN python -V RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc RUN echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc RUN pip install jupyter &&\ wget https://litipk.github.io/Jupyter-PHP-Installer/dist/jupyter-php-installer.phar &&\ locale-gen en_US.UTF-8 &&\ export LANG=en_US.UTF-8 &&\ add-apt-repository ppa:ondrej/php -y &&\ apt-get update -y &&\ apt-get install php7.1 -y &&\ curl -sS https://getcomposer.org/installer | php &&\ mv composer.phar /usr/local/bin/composer &&\ composer require psy/psysh &&\ apt-get install php-zmq -y &&\ php jupyter-php-installer.phar install -vv EXPOSE 80 ENV DEBIAN_FRONTEND dialog --------------------------- ------------------------ # Firefox over VNC # # VERSION 0.3 FROM ubuntu # Install vnc, xvfb in order to create a 'fake' display and firefox RUN apt-get update && apt-get install -y x11vnc xvfb firefox RUN mkdir ~/.vnc # Setup a password RUN x11vnc -storepasswd 1234 ~/.vnc/passwd # Autostart firefox (might not be the best way, but it does the trick) RUN bash -c 'echo "firefox" >> /.bashrc' EXPOSE 5900 CMD ["x11vnc", "-forever", "-usepw", "-create"] ------------------------------------- $course_description = nl2br($_POST["course_description"]); $course_description = trim($course_description); ------------- install libgtk2.0-0 xdg-utils nano x11vnc xvfb https://download.zerobrane.com/ZeroBraneStudioEduPack-1.80-linux.sh a60bbdd51d94 docker run -i -t -p 5900:5900 -display :1.0 jacknorthrup/zbstudio:latest x11vnc -forever -usepw -create >>>>>>>>>>> ????? docker-version 0.6.1 FROM ubuntu:13.10 MAINTAINER Tianon Gravi (@tianon) # Packaged dependencies RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \ apt-utils \ aufs-tools \ automake \ btrfs-tools \ build-essential \ curl \ dpkg-sig \ git \ iptables \ libapparmor-dev \ libcap-dev \ libsqlite3-dev \ mercurial \ reprepro \ ruby1.9.1 \ ruby1.9.1-dev \ s3cmd=1.1.0* \ --no-install-recommends ------------------------------------------- FROM ducatel/visual-studio-linux-build-box RUN apt-get update && DEBIAN_FRONTEND=noninteractive \ apt-get install -y libxml2-dev \ pkg-config \ libssl-dev \ libsasl2-dev \ automake \ autoconf \ libtool \ apt-utils \ aufs-tools \ automake \ btrfs-tools \ build-essential \ curl \ dpkg-sig \ git \ iptables \ libapparmor-dev \ libcap-dev \ libsqlite3-dev \ mercurial \ reprepro \ ruby1.9.1 \ ruby1.9.1-dev \ cmake \ make \ vim \ build-essential \ mc \ nano \ wget \ curl \ htop \ locate \ sqlite3 \ libsqlite3-dev \ zlib1g-dev \ x11vnc \ xvfb \ pip \ firefox \ python3-pip \ python3-pyqt4 \ python3-pyqt5 \ python3-pyqt5.qtsvg \ python3-pyqt5.qtwebkit \ python3-pip RUN mkdir ~/.vnc # Setup a password RUN x11vnc -storepasswd 1234 ~/.vnc/passwd RUN git clone https://github.com/mongodb/mongo-c-driver.git && \ cd mongo-c-driver && \ git checkout 1.3.5 && \ ./autogen.sh && \ make && make install RUN pip3 install Flask twilio run pip freeze > requirements.txt

How to add nearest repositories

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

deb mirror://mirrors.ubuntu.com/mirrors.txt zesty main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-security main restricted universe multiverse


/etc/apt/sources.list 

RUN sed -i 'deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-security main restricted universe multiverse\n/' /etc/apt/sources.list 
RUN sed -i 'deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-backports main restricted universe multiverse\n/' /etc/apt/sources.list 
RUN sed -i 'deb mirror://mirrors.ubuntu.com/mirrors.txt zesty-updates main restricted universe multiverse\n/' /etc/apt/sources.list 
RUN sed -i 'deb mirror://mirrors.ubuntu.com/mirrors.txt zesty main restricted universe multiverse' /etc/apt/sources.list