├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── contrib └── color_ls.sh ├── jupyterhub_config.py ├── mongodb-org-4.2.repo ├── svn-servers └── texlive.profile /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | cpuid/cpuid 3 | nohup.out 4 | **/*.swp 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # docker build -t math-server:latest --build-arg http_proxy="http://proxy:8080" --build-arg https_proxy="http://proxy:8080" . 3 | 4 | # In case you're building the image behind a proxy, use 5 | # docker build -t math-server:latest --build-arg http_proxy="http://proxy:8080" --build-arg https_proxy="http://proxy:8080" . 6 | 7 | # 8787 for RStudio 8 | # 8000 for Jupyter 9 | 10 | # docker run -d -p 8787:8787 -p 8000:8000 --name ms1 math-server 11 | 12 | FROM centos:7 13 | 14 | MAINTAINER felipenoris 15 | 16 | WORKDIR /root 17 | 18 | RUN yum update -y && yum install -y epel-release && yum clean all 19 | 20 | RUN yum update -y && yum install -y \ 21 | p7zip \ 22 | p7zip-plugins \ 23 | bison \ 24 | bzip2 \ 25 | bzip2-devel \ 26 | cmake \ 27 | curl-devel \ 28 | cronie \ 29 | czmq \ 30 | expat-devel \ 31 | file \ 32 | flex \ 33 | fontconfig-devel \ 34 | gcc \ 35 | gcc-c++ \ 36 | gcc-gfortran \ 37 | gdb \ 38 | gettext-devel \ 39 | glibc-devel \ 40 | gperf \ 41 | java-1.8.0-openjdk-devel \ 42 | lynx \ 43 | libaio \ 44 | libattr-devel \ 45 | libcurl \ 46 | libcurl-devel \ 47 | libedit-devel libffi-devel \ 48 | libgcc \ 49 | libstdc++-static \ 50 | libtool \ 51 | m4 \ 52 | make \ 53 | man \ 54 | nano \ 55 | nload \ 56 | neovim \ 57 | htop \ 58 | openssl \ 59 | openssl098e \ 60 | openssl-devel \ 61 | patch \ 62 | perl-ExtUtils-MakeMaker \ 63 | svn \ 64 | unzip \ 65 | valgrind \ 66 | ruby \ 67 | ruby-devel \ 68 | sqlite \ 69 | sqlite-devel \ 70 | squashfs-tools \ 71 | telnet \ 72 | vim \ 73 | wget \ 74 | zeromq \ 75 | zlib \ 76 | zlib-devel \ 77 | zip \ 78 | && yum clean all 79 | 80 | ENV PATH /usr/local/sbin:/usr/local/bin:$PATH 81 | 82 | ENV CPATH /usr/include/glpk 83 | 84 | ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64 85 | 86 | # TeX 87 | RUN yum -y install perl-Tk perl-Digest-MD5 xorriso && yum clean all 88 | 89 | ADD texlive.profile texlive.profile 90 | 91 | # Offline TeX Live installation 92 | # https://tex.stackexchange.com/questions/370256/how-to-install-tex-live-offline-on-ubuntu 93 | # https://stackoverflow.com/questions/22028795/is-it-possible-to-mount-an-iso-inside-a-docker-container 94 | # http://www.gnu.org/software/xorriso/ 95 | # non-interactive http://www.tug.org/pipermail/tex-live/2008-June/016323.html 96 | # Official link: http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz 97 | 98 | ENV TEXLIVE_VERSION 2019 99 | 100 | RUN wget http://mirrors.rit.edu/CTAN/systems/texlive/Images/texlive$TEXLIVE_VERSION.iso \ 101 | && wget http://mirrors.rit.edu/CTAN/systems/texlive/Images/texlive$TEXLIVE_VERSION.iso.md5 \ 102 | && RESULT=$(md5sum -c texlive$TEXLIVE_VERSION.iso.md5) \ 103 | && echo ${RESULT} > ~/check-texlive-md5.txt \ 104 | && osirrox -indev ./texlive$TEXLIVE_VERSION.iso -extract / ./texlive_install \ 105 | && rm -f texlive$TEXLIVE_VERSION.iso \ 106 | && ./texlive_install/install-tl -profile ./texlive.profile \ 107 | && rm -rf texlive_install 108 | 109 | # Uncomment lines below to update TeX Live to latest packages 110 | # Sets texlive update mirror 111 | # https://tex.stackexchange.com/questions/378210/installing-tl-using-iso-leads-to-local-unknown-repository-tlpdb 112 | #RUN tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet 113 | #RUN tlmgr update --self --all --reinstall-forcibly-removed 114 | 115 | ENV PATH /usr/local/texlive/distribution/bin/x86_64-linux:$PATH 116 | 117 | # GIT - https://git-scm.com/ 118 | # http://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/# 119 | ENV GIT_VER 2.24.1 120 | 121 | RUN wget https://www.kernel.org/pub/software/scm/git/git-$GIT_VER.tar.gz \ 122 | && tar xf git-$GIT_VER.tar.gz && cd git-$GIT_VER \ 123 | && make -j"$(nproc --all)" prefix=/usr/local all \ 124 | && make prefix=/usr/local -j"$(nproc --all)" install \ 125 | && cd .. && rm -f git-$GIT_VER.tar.gz && rm -rf git-$GIT_VER 126 | 127 | # Makes git use https by default 128 | RUN git config --global url."https://".insteadOf git:// 129 | 130 | # llvm needs CMake 2.8.12.2 or higher 131 | # https://cmake.org/download/ 132 | ENV CMAKE_VER_MAJ 3.16 133 | ENV CMAKE_VER_MIN .1 134 | ENV CMAKE_VER $CMAKE_VER_MAJ$CMAKE_VER_MIN 135 | 136 | RUN wget https://cmake.org/files/v$CMAKE_VER_MAJ/cmake-$CMAKE_VER.tar.gz \ 137 | && tar xf cmake-$CMAKE_VER.tar.gz && cd cmake-$CMAKE_VER \ 138 | && ./bootstrap && make -j"$(nproc --all)" && make -j"$(nproc --all)" install \ 139 | && cd .. && rm -rf cmake-$CMAKE_VER && rm -f cmake-$CMAKE_VER.tar.gz 140 | 141 | ENV CMAKE_ROOT /usr/local/share/cmake-$CMAKE_VER_MAJ 142 | 143 | # node https://nodejs.org/en/ - https://tecadmin.net/install-latest-nodejs-and-npm-on-centos/ 144 | RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash - 145 | RUN yum install -y nodejs 146 | 147 | # reinstall npm with the lastest version 148 | # Workaround https://github.com/npm/npm/issues/15558 149 | # with https://github.com/npm/npm/issues/15611#issuecomment-289133810 150 | RUN npm install npm \ 151 | && rm -rf /usr/local/lib/node_modules \ 152 | && mv node_modules /usr/local/lib/ 153 | 154 | # Makes npm work behind proxy if http_proxy variable is set 155 | RUN npm config set proxy ${http_proxy} \ 156 | && npm config set https-proxy ${https_proxy} \ 157 | && npm config set registry http://registry.npmjs.org/ \ 158 | && npm set strict-ssl false 159 | 160 | # Anaconda 161 | # https://repo.continuum.io/archive 162 | ENV CONDA_VER 2019.10 163 | 164 | ENV PATH $PATH:/usr/local/conda/anaconda3/bin 165 | 166 | RUN wget https://repo.continuum.io/archive/Anaconda3-$CONDA_VER-Linux-x86_64.sh \ 167 | && bash Anaconda3-$CONDA_VER-Linux-x86_64.sh -b -p /usr/local/conda/anaconda3 \ 168 | && rm -f Anaconda3-$CONDA_VER-Linux-x86_64.sh \ 169 | && conda update -n base conda -y 170 | 171 | RUN conda update --all 172 | 173 | # Install py2 and py3 envs, and registers jupyterhub kernels 174 | # https://github.com/jupyter/jupyter/issues/71 175 | 176 | # install everything (except JupyterHub itself) with Python 2 and 3. Jupyter is included in Anaconda. 177 | RUN conda create -n py3 python=3 anaconda ipykernel \ 178 | && conda create -n py2 python=2 anaconda ipykernel 179 | 180 | # Set PYTHON env variable to point to Python3. This will be used by PyCall.jl julia package. 181 | ENV PYTHON /usr/local/conda/anaconda3/envs/py3/bin/python 182 | 183 | # register py2 kernel 184 | RUN source activate py2 && python -m ipykernel install 185 | 186 | RUN conda install -c conda-forge jupyterhub -y 187 | 188 | # ipywidgets: https://github.com/ipython/ipywidgets 189 | RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension 190 | 191 | # Jupyterlab: https://github.com/jupyterlab/jupyterlab 192 | RUN source activate py3 && conda install -c conda-forge jupyterlab -y 193 | 194 | # Integration between jupyterhub and jupyterlab 195 | # not working: https://github.com/jupyterhub/jupyterlab-hub/issues/78 196 | #RUN jupyter labextension install @jupyterlab/hub-extension 197 | 198 | # Support for other languages 199 | # https://github.com/jupyter/jupyter/wiki/Jupyter-kernels 200 | 201 | # R 202 | RUN yum -y install \ 203 | lapack-devel \ 204 | blas-devel \ 205 | libicu-devel \ 206 | unixodbc-devel \ 207 | boost \ 208 | boost-devel \ 209 | libxml2 \ 210 | libxml2-devel \ 211 | R \ 212 | && yum clean all 213 | 214 | # Set default CRAN Mirror 215 | RUN echo 'options(repos = c(CRAN="https://ftp.osuosl.org/pub/cran/"))' >> /usr/lib64/R/library/base/R/Rprofile 216 | 217 | # RStudio - https://www.rstudio.com/products/rstudio/download-server/ 218 | ENV RSTUDIO_VER 1.2.5019 219 | 220 | RUN wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-$RSTUDIO_VER-x86_64.rpm \ 221 | && echo "748bd5a45f1c386b538da9be83203c24 rstudio-server-rhel-$RSTUDIO_VER-x86_64.rpm" > RSTUDIOMD5 \ 222 | && RESULT=$(md5sum -c RSTUDIOMD5) \ 223 | && echo ${RESULT} > ~/check-rstudio-md5.txt \ 224 | && yum -y install --nogpgcheck rstudio-server-rhel-$RSTUDIO_VER-x86_64.rpm \ 225 | && yum clean all \ 226 | && rm -f rstudio-server-rhel-$RSTUDIO_VER-x86_64.rpm && rm -f RSTUDIOMD5 227 | 228 | # Shiny - https://www.rstudio.com/products/shiny/download-server/ 229 | ENV SHINY_VER 1.5.12.933 230 | 231 | RUN R -e 'install.packages("shiny", repos="https://cran.rstudio.com/")' \ 232 | && wget https://download3.rstudio.org/centos6.3/x86_64/shiny-server-$SHINY_VER-x86_64.rpm \ 233 | && echo "af1daa27220cef698efa600072509a25 shiny-server-$SHINY_VER-x86_64.rpm" > SHINYSERVERMD5 \ 234 | && RESULT=$(md5sum -c SHINYSERVERMD5) \ 235 | && echo ${RESULT} > ~/check-shiny-server-md5.txt \ 236 | && yum -y install --nogpgcheck shiny-server-$SHINY_VER-x86_64.rpm \ 237 | && yum clean all \ 238 | && cd && rm -f SHINYSERVERMD5 && rm -f shiny-server-$SHINY_VER-x86_64.rpm 239 | 240 | # Julia - https://julialang.org/downloads/ 241 | ENV JULIA_VER_MAJ 1.3 242 | ENV JULIA_VER_MIN .0 243 | ENV JULIA_VER $JULIA_VER_MAJ$JULIA_VER_MIN 244 | 245 | RUN wget https://julialang-s3.julialang.org/bin/linux/x64/$JULIA_VER_MAJ/julia-$JULIA_VER-linux-x86_64.tar.gz \ 246 | && mkdir /usr/local/julia \ 247 | && tar xf julia-$JULIA_VER-linux-x86_64.tar.gz --directory /usr/local/julia --strip-components=1 \ 248 | && ln -s /usr/local/julia/bin/julia /usr/local/bin/julia \ 249 | && rm -f julia-$JULIA_VER-linux-x86_64.tar.gz 250 | 251 | ENV JULIA_PKGDIR /usr/local/julia/share/julia/site 252 | 253 | # R 254 | # http://irkernel.github.io/installation/ 255 | RUN yum -y install czmq-devel && yum clean all 256 | 257 | RUN R -e "install.packages('IRkernel')" 258 | 259 | RUN R -e "IRkernel::installspec(user = FALSE)" 260 | 261 | # Optional configuration file for svn 262 | ADD svn-servers /etc/subversion/servers 263 | 264 | # coin SYMPHONY 265 | # https://github.com/coin-or/SYMPHONY 266 | ENV SYMPHONY_VER 5.6 267 | 268 | RUN git clone https://www.github.com/coin-or/coinbrew \ 269 | && cd coinbrew \ 270 | && ./coinbrew fetch --no-prompt SYMPHONY:stable/$SYMPHONY_VER \ 271 | && ./coinbrew build --no-prompt SYMPHONY --prefix=/usr/local --parallel-jobs="$(nproc --all)" \ 272 | && ./coinbrew install SYMPHONY \ 273 | && cd .. && rm -rf coinbrew 274 | 275 | # bash Jupyter kernel 276 | RUN source activate py3 && pip install bash_kernel \ 277 | && python3 -m bash_kernel.install 278 | 279 | # pigz: http://zlib.net/pigz/ 280 | ENV PIGZ_VER 2.4 281 | 282 | RUN wget http://zlib.net/pigz/pigz-$PIGZ_VER.tar.gz \ 283 | && tar xf pigz-$PIGZ_VER.tar.gz \ 284 | && cd pigz-$PIGZ_VER \ 285 | && make -j"$(nproc --all)" \ 286 | && cp pigz /usr/local/bin \ 287 | && cp unpigz /usr/local/bin \ 288 | && cd .. && rm -rf pigz-$PIGZ_VER && rm -f pigz-$PIGZ_VER.tar.gz 289 | 290 | # uchardet: https://www.freedesktop.org/wiki/Software/uchardet/ 291 | RUN git clone --depth=1 https://anongit.freedesktop.org/git/uchardet/uchardet.git \ 292 | && cd uchardet \ 293 | && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release . \ 294 | && make -j"$(nproc --all)" \ 295 | && make install \ 296 | && cd .. && rm -rf uchardet 297 | 298 | ENV JAVA_HOME /etc/alternatives/java_sdk 299 | 300 | # Redis (https://redis.io) 301 | RUN wget http://download.redis.io/redis-stable.tar.gz \ 302 | && tar xf redis-stable.tar.gz \ 303 | && cd redis-stable \ 304 | && make -j"$(nproc --all)" \ 305 | && make install \ 306 | && cd .. && rm -rf redis-stable && rm -f redis-stable.tar.gz 307 | 308 | # MongoDB (https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/) 309 | ADD mongodb-org-4.2.repo /etc/yum.repos.d/mongodb-org-4.2.repo 310 | RUN yum install -y mongodb-org 311 | 312 | ################# 313 | ## LIBS 314 | ################# 315 | 316 | # Optional libraries for packages 317 | #RUN yum -y install \ 318 | # cyrus-sasl-devel \ 319 | # freeglut \ 320 | # freeglut-devel \ 321 | # freetype-devel \ 322 | # geos-devel \ 323 | # gdal-devel \ 324 | # glpk-devel \ 325 | # gsl-devel \ 326 | # gtk3-devel \ 327 | # hdf5 \ 328 | # ImageMagick \ 329 | # lcms2-devel \ 330 | # libjpeg-devel \ 331 | # libpng \ 332 | # libpng-devel \ 333 | # libtiff-devel \ 334 | # libtool \ 335 | # libwebp-devel \ 336 | # libxslt-devel \ 337 | # libxml2-devel \ 338 | # libzip-devel \ 339 | # mpfr-devel \ 340 | # pandoc \ 341 | # proj-devel \ 342 | # proj-epsg \ 343 | # proj-nad \ 344 | # tcl-devel \ 345 | # tk-devel \ 346 | # && yum clean all 347 | 348 | RUN yum -y install \ 349 | hdf5 \ 350 | libxml2-devel \ 351 | libzip-devel \ 352 | && yum clean all 353 | 354 | # http://ipyparallel.readthedocs.org/en/latest/ 355 | #RUN ipcluster nbextension enable 356 | 357 | # Improve link to shared libraries 358 | ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib64/R/lib:/usr/local/lib:/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib:/usr/local/lib 359 | 360 | # ffmpeg 361 | RUN rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro \ 362 | && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm \ 363 | && yum install ffmpeg ffmpeg-devel -y 364 | 365 | # Altair - https://altair-viz.github.io/installation.html 366 | RUN conda install altair --channel conda-forge -y 367 | 368 | # Plotly for Python 369 | RUN conda install plotly -y 370 | 371 | #################### 372 | ## Services 373 | #################### 374 | 375 | # 8787 for RStudio 376 | # 8000 for Jupyter 377 | EXPOSE 8787 8000 378 | 379 | ADD jupyterhub_config.py jupyterhub_config.py 380 | 381 | ENV TERM xterm 382 | 383 | CMD /usr/lib/rstudio-server/bin/rserver \ 384 | && jupyterhub --no-ssl -f jupyterhub_config.py 385 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2019 Felipe Noronha 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # math-server-docker 3 | 4 | [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE) 5 | 6 | Dockerfile to build the ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages. 7 | 8 | It's based on CentOS 7 image, which is a very stable Linux distribution, compatible with Red Hat (widely used in Corporations), 9 | but often offers outdated packages. In order to provide up-to-date tools, this Dockerfile builds most tools from source. 10 | 11 | ## List of tools 12 | 13 | * [Jupyterhub](https://github.com/jupyter/jupyterhub) and [Jupyterlab](https://github.com/jupyterlab/jupyterlab) with support for the following languages: 14 | 15 | * Python 2 16 | 17 | * Python 3 18 | 19 | * R 20 | 21 | * Bash 22 | 23 | * [RStudio Server](https://www.rstudio.com/) 24 | 25 | * [Shiny Server](https://www.rstudio.com/products/shiny/shiny-server2/) 26 | 27 | There's also a number of utilities under the hood: 28 | 29 | * [Julia](https://julialang.org/) 30 | 31 | * [p7zip](http://p7zip.sourceforge.net) 32 | 33 | * [Java SDK](http://openjdk.java.net) 34 | 35 | * [Redis](https://redis.io) 36 | 37 | * [MongoDB](https://www.mongodb.com) 38 | 39 | * [git](https://git-scm.com) 40 | 41 | * [svn](https://subversion.apache.org) 42 | 43 | * [sqlite3](https://www.sqlite.org) 44 | 45 | * [pigz](https://zlib.net/pigz/) 46 | 47 | * [Node.js](https://nodejs.org) 48 | 49 | * [LaTeX](https://www.latex-project.org) 50 | 51 | * [HDF5](https://support.hdfgroup.org/HDF5/) 52 | 53 | * [uchardet](https://www.freedesktop.org/wiki/Software/uchardet/) 54 | 55 | ## Usage 56 | 57 | To build the image, run the following comand: 58 | 59 | ``` 60 | # docker build -t math-server . 61 | ``` 62 | 63 | Be patient. It may take up to 8 hours to complete. 64 | 65 | After the build is complete, you can start the server with: 66 | 67 | ``` 68 | # docker run -d -p 8787:8787 -p 8000:8000 --name ms1 math-server 69 | ``` 70 | 71 | With a running container, you can go ahead and create users: 72 | 73 | ``` 74 | # docker exec ms1 useradd myuser 75 | 76 | # docker exec -it ms1 passwd myuser 77 | ``` 78 | 79 | The default ports are: 80 | 81 | * `8787` for RStudio 82 | 83 | * `8000` for Jupyter 84 | 85 | ## Requirements 86 | 87 | [Docker](https://www.docker.com/). 88 | 89 | ## Application specific notes 90 | 91 | The last command in the Dockerfile starts Jupyterhub and RStudio: 92 | 93 | ```shell 94 | CMD /usr/lib/rstudio-server/bin/rserver \ 95 | && jupyterhub --no-ssl -f jupyterhub_config.py 96 | ``` 97 | 98 | ### Jupyter 99 | 100 | Data files are at `/usr/local/share/jupyter/hub`. 101 | 102 | By default, Jupyter will be accessible on the following link: `http://localhost:8000`, and will create state files (`jupyterhub_cookie_secret`, `jupyterhub.sqlite`) on current directory, and use default configuration. 103 | 104 | You can generate a sample configuration file with: 105 | 106 | ``` 107 | # jupyterhub --generate-config 108 | ``` 109 | 110 | To start the server using a configuration file, use: 111 | 112 | ``` 113 | # jupyterhub -f jupyterhub_config.py 114 | ``` 115 | 116 | To set IP and port, use: 117 | 118 | ``` 119 | # jupyterhub --ip=192.168.1.2 --port=443 120 | ``` 121 | 122 | You may have to open port for external access: 123 | 124 | ``` 125 | # /sbin/iptables -I INPUT -p tcp -m tcp --dport 8000 -j ACCEPT 126 | # /sbin/service iptables save 127 | ``` 128 | 129 | For `https` support, add the following lines to the config file: 130 | 131 | ```python 132 | c.JupyterHub.port = 443 133 | c.JupyterHub.ssl_cert = '/root/.ssh/sample-cert.pem' 134 | c.JupyterHub.ssl_key = '/root/.ssh/sample-key.pem' 135 | ``` 136 | 137 | `443` is the default port for https. So the server will be accessible using https://localhost. 138 | 139 | `sample-cert.pem` is the signed certificate file, and `sample-key.pem` is the private ssl key. 140 | 141 | You can generate self signed certificate file by running the code below, but be aware that your browser will not recognize the certificate as trusted. 142 | 143 | ``` 144 | # mkdir ~/.ssh 145 | # openssl req -x509 -newkey rsa:2048 -keyout ~/.ssh/sample-key.pem -out ~/.ssh/sample-cert.pem -days 9999 -nodes -subj "/C=BR/ST=Rio de Janeiro/L=Rio de Janeiro/O=org/OU=unit/CN=website" 146 | # chmod 400 sample*.pem 147 | ``` 148 | 149 | This project provides a minimal `jupyter_config.py` configuration file that sets 150 | a few important environment variables that should be passed to child spawned processes, namely: `'PATH', 'LD_LIBRARY_PATH', 'JAVA_HOME', 'CPATH', 'CMAKE_ROOT', 'http_proxy', 'https_proxy'`. 151 | 152 | ### Jupyterlab 153 | 154 | Jupyterlab is the default user interface. This behavior is set by the following line in the provided jupyterhub_config.py file: 155 | 156 | ``` 157 | c.Spawner.default_url = '/lab' 158 | ``` 159 | 160 | To revert to old Jupyter user interface, you can either access manually the `/tree` url (as in `http://localhost:8000/user/username/tree`) 161 | or edit `jupyterhub_config.py` deleting the `c.Spawner.default_url` line. 162 | 163 | See [Jupyterlab documentation](http://jupyterlab.readthedocs.io/en/latest/user/jupyterhub.html) for more information. 164 | 165 | ### RStudio 166 | 167 | Configuration files are at `/etc/rstudio`. There's also the Server Options file at `/usr/lib/rstudio-server/R/ServerOptions.R`. 168 | 169 | Default port is 8787. 170 | 171 | Change the default port by editing `rserver.conf`. The following will change to port 80: 172 | 173 | ``` 174 | # echo -e "www-port=80" | tee /etc/rstudio/rserver.conf 175 | # rstudio-server restart 176 | # rstudio-server verify-installation 177 | ``` 178 | 179 | `auth-pam-sessions-profile` directive on /etc/rstudio.rserver.conf may not work. If that happens, RStudio will look at `/etc/pam.d/rstudio`. 180 | 181 | Proxy settings are not configured in RStudio by default. If you're running behind proxy, you should update `ServerOptions.R` file. 182 | 183 | ``` 184 | RUN echo "options(download.file.method = 'wget')" >> /usr/lib/rstudio-server/R/ServerOptions.R 185 | RUN echo "Sys.setenv(http_proxy = 'my-proxy-url')" >> /usr/lib/rstudio-server/R/ServerOptions.R 186 | RUN echo "Sys.setenv(https_proxy = 'my-proxy-url')" >> /usr/lib/rstudio-server/R/ServerOptions.R 187 | ``` 188 | 189 | ## Packages 190 | 191 | **Python** 192 | 193 | Users can packages with `conda` or `pip` command line. 194 | 195 | With pip, users can install local packages for Python2 using: 196 | 197 | ``` 198 | $ source activate py2 199 | 200 | $ pip install --user pkgname 201 | ``` 202 | 203 | And also for Python3 using: 204 | 205 | ``` 206 | $ source activate py3 207 | 208 | $ pip install --user pkgname 209 | ``` 210 | 211 | Refer to `conda` documentation to install packages using `conda` utility. 212 | 213 | **R** 214 | 215 | Check package locations with `$ R -e '.libPaths()'`. 216 | 217 | System packages will be installed at `/usr/lib64/R/library`. 218 | 219 | Each user can have a local package dir, automatically created under `~/R`. 220 | 221 | *root user* will add packages with `R -e 'install.packages("pkg-name")'` command. 222 | 223 | **Julia** 224 | 225 | Since Julia v1.0, system packages are disabled. Only user-level packages are supported. 226 | 227 | To install IJulia kernel, open a terminal and use the following commands: 228 | 229 | ```shell 230 | julia> using Pkg 231 | 232 | julia> pkg"add IJulia" 233 | ``` 234 | 235 | Restart your Jupyter session. After that, a Julia notebook option should show up. 236 | 237 | **LaTeX** 238 | 239 | The Docker image comes with a LaTeX distribution that is installed using [texlive](http://www.tug.org/texlive/) tool. 240 | TeX packages can me managed using `tlmgr`. 241 | 242 | System-wide packages can be installed using: 243 | 244 | ``` 245 | # tlmgr install [pkgname] 246 | ``` 247 | 248 | Users can also install local packages. To do that, a user must initialize a `~/texmf` tree: 249 | 250 | ``` 251 | $ tlmgr init-usertree 252 | ``` 253 | 254 | After that, the user can install local packages using: 255 | 256 | ``` 257 | $ tlmgr --usermode install [pkgname] 258 | ``` 259 | 260 | ## References 261 | 262 | * [Jupyterhub Docs](https://jupyterhub.readthedocs.org/en/latest/index.html) 263 | 264 | * [Jupyterlab Docs](http://jupyterlab.readthedocs.io) 265 | 266 | * [Full list of supported kernels for Jupyter](https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages) 267 | 268 | * [RStudio Server Admin Guide](https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.99.879-admin-guide.pdf) 269 | 270 | * [Shiny Server Admin Guide](http://rstudio.github.io/shiny-server/latest/) 271 | -------------------------------------------------------------------------------- /contrib/color_ls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Add these instructions to your ~/.bashrc file to get automatic color for `ls` command. 4 | # 5 | 6 | export LS_OPTIONS='--color=auto' 7 | alias ls='ls $LS_OPTIONS' 8 | -------------------------------------------------------------------------------- /jupyterhub_config.py: -------------------------------------------------------------------------------- 1 | 2 | # Whitelist of environment variables for the subprocess to inherit 3 | # c.Spawner.env_keep = ['PATH', 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL'] 4 | c.Spawner.env_keep = [ 'PATH', 'LD_LIBRARY_PATH', 'JAVA_HOME', 'CPATH', 'CMAKE_ROOT', "PYTHON" ] 5 | 6 | # use jupyterlab as default user interface 7 | #c.Spawner.default_url = '/lab' 8 | 9 | # set of usernames of admin users 10 | # 11 | # If unspecified, only the user that launches the server will be admin. 12 | #c.Authenticator.admin_users = set(['admin']) 13 | 14 | c.JupyterHub.extra_log_file = '/var/log/jupyterhub.log' 15 | 16 | # https://github.com/jupyterhub/jupyterlab-hub 17 | c.Spawner.cmd = ['jupyter-labhub'] -------------------------------------------------------------------------------- /mongodb-org-4.2.repo: -------------------------------------------------------------------------------- 1 | [mongodb-org-4.2] 2 | name=MongoDB Repository 3 | baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/ 4 | gpgcheck=1 5 | enabled=1 6 | gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc 7 | -------------------------------------------------------------------------------- /svn-servers: -------------------------------------------------------------------------------- 1 | [Global] 2 | -------------------------------------------------------------------------------- /texlive.profile: -------------------------------------------------------------------------------- 1 | selected_scheme scheme-full 2 | TEXDIR /usr/local/texlive/distribution 3 | TEXMFCONFIG ~/.texlive/texmf-config 4 | TEXMFHOME ~/texmf 5 | TEXMFLOCAL /usr/local/texlive/texmf-local 6 | TEXMFSYSCONFIG /usr/local/texlive/distribution/texmf-config 7 | TEXMFSYSVAR /usr/local/texlive/distribution/texmf-var 8 | TEXMFVAR ~/.texlive/texmf-var 9 | binary_x86_64-linux 1 10 | instopt_adjustpath 0 11 | instopt_adjustrepo 1 12 | instopt_letter 0 13 | instopt_portable 0 14 | instopt_write18_restricted 1 15 | tlpdbopt_autobackup 1 16 | tlpdbopt_backupdir tlpkg/backups 17 | tlpdbopt_create_formats 1 18 | tlpdbopt_desktop_integration 1 19 | tlpdbopt_file_assocs 1 20 | tlpdbopt_generate_updmap 0 21 | tlpdbopt_install_docfiles 1 22 | tlpdbopt_install_srcfiles 1 23 | tlpdbopt_post_code 1 24 | tlpdbopt_sys_bin /usr/local/bin 25 | tlpdbopt_sys_info /usr/local/share/info 26 | tlpdbopt_sys_man /usr/local/share/man 27 | tlpdbopt_w32_multi_user 1 --------------------------------------------------------------------------------