Skip to content
Shekhar Prasad Rajak edited this page Jun 2, 2018 · 5 revisions

If we want to test daru-view in isolated linux system, then docker is good option for us.

Let's setup an Ubuntu OS and install daru-view and its development dependencies:

Dockerfile

FROM ubuntu

# in case need to download something
RUN apt-get update  && apt-get install -y wget && rm -rf /var/lib/apt/lists/*

# to clone from git
RUN apt-get update && apt-get install -y git

# gem
RUN apt-get update && apt-get install -y rubygems

# nokogiri gem install error , fixed via these commands:
RUN apt-get update && apt-get install -y ruby`ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]'`-dev

RUN apt-get install -y build-essential patch ruby-dev zlib1g-dev liblzma-dev

# install bundler
RUN gem install bundler

# install ruby gem daru-view and it's dependencies
RUN gem install daru-view

# to install jupter notebook to run iruby notebook
#  - install python
#     a) to install 2.7 and pip
# RUN apt-get update && apt-get -y install python2.7 python-pip python-dev
#     b) to install 3.6 and pip
RUN apt-get update && apt-get -y install software-properties-common
RUN apt-get update && add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update && apt-get -y install python3.6 python-pip python-dev

#  - check versions: python --version && pip --version

#  - installing ipython notebook
RUN apt-get update && apt-get -y install ipython ipython-notebook
#     Now we can move on to installing Jupyter Notebook
RUN pip install --upgrade pip && pip install jupyter

# now we can run jupyter notebook using command : `jupyter notebook`.

# note:   IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
#    When using Python 2.7, please install IPython 5.x LTS Long Term Support
# version.
#    Beginning with IPython 6.0, Python 3.3 and above is required.

# for gem install iruby
# (dependencies are under daru/view/spec/dummy_iruby/Gemfile)
RUN apt-get update && apt-get -y install autoconf

# note : for iruby notebook we must have libtool and autoconf installed.
# we can check them using `libtool -V` and `autoconf -V` ,
# `automake --version`.

# install curl to use in rake task, like updating js files
RUN apt-get update && apt-get install -y curl 


create docker image

  1. create a image named my-ubuntu : docker build -t my-ubuntu .
  2. run the image and go into ubuntu os installed daru-view : docker run -it my-ubuntu /bin/bash
  3. You can clone the repo using git clone https://github.com/SciRuby/daru-view and do development things e.g. bundle install, bundle exec rspec , bundle exec rubocop.

Clone this wiki locally