Docker for Julia language with X11 (User Interface) support and many pre-installed packages and wrapper script for running the docker.
Benefit
- A ready-to-use Julia development environment, with zero configuration effort required, which can be used from any Linux distribution or any operating system with Docker support.
- Standard and reproducible development environment.
Features
- Many pre-installed packages for statics, charts, symbolic math and so on.
- Pre-configured Julia Notebook
- Jupyter Notebook for Julia.
- X11 Support
- Allows to run graphical windows and GUIs (Graphical User Interfaces) such as X11 widgets, PyPlot charts, Plots chart and so on.
- Wrapper Unix shell script which simplifies running the docker and mapping the current directory to the docker container.
Pre-installed packages
- Interfaces
- IJulia => Julia Notebook
- Plot libraries
- Plots
- PyPlot
- StatsPlot
- Statistcs:
- Distributions => Statistical Distributions
- DataFrame
- DataStreams
- Standard Format Parsers
- JSON
- CSV
- XLSX - Excel Parser
- Symbolic Math
- SymPy
- Literate Programming
- Weave
STEP 1: Build the docker.
$ make build
STEP 2: Test the docker with. The command will run a Julia shell.
$ make run
sh ./julia-box-shell.sh
non-network local connections being added to access control list
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> 0:2:10 .|> exp(x)
ERROR: UndefVarError: x not defined
Stacktrace:
[1] top-level scope at REPL[1]:1
julia> 0:2:10 .|> exp
6-element Array{Float64,1}:
1.0
7.38905609893065
54.598150033144236
403.4287934927351
2980.9579870417283
22026.465794806718
STEP 3: Install the wrapper script.
- Just copy the wrapper script to any directory in $PATH variable and run $ julia-box-shell.sh
mkdir -p ~/bin
chmod +x julia-box-shell.sh
cp julia-box-shell.sh ~/bin
# If the directory ~/bin is not in the PATH variable.
echo "export PATH=~/bin:$PATH" >> ~/.bashrc
STEP 4: Run wrapper script and open Julia shell.
$ ./julia-box-shell.sh julia
non-network local connections being added to access control list
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using SymPy
julia> x = Sym("x")
x
julia> expand((x - 4)^3)
3 2
x - 12⋅x + 48⋅x - 64
julia>
Once the docker is buitl, the following functionalities can be used:
Run bash Unix shell
- $ ./julia-box-shell.sh sh
- $ ./julia-box-shell.sh bash
$ ./julia-box-shell.sh sh
non-network local connections being added to access control list
eniac@localhost:/work$ whoami
eniac
eniac@localhost:/work$ ls -la
total 40
eniac@localhost:/work$ ls
Dockerfile FIR_design.jl Makefile README.org julia-box-shell.sh script.jl
Run Julia Shell
- $ ./julia-box-shell.sh ju
- $ ./julia-box-shell.sh julia
$ ./julia-box-shell.sh julia
non-network local connections being added to access control list
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using SymPy
julia> x = Sym("x")
x
julia> expand((x - 4)^3)
3 2
x - 12⋅x + 48⋅x - 64
Run Jupyter Notebook (IJulia)
Start Jupyter Notebook Daemon
- $ ./julia-box-shell.sh jupyter start
- $ ./julia-box-shell.sh ju start
Start Jupyter Notebook Daemon
- $ ./julia-box-shell.sh jupyter stop
- $ ./julia-box-shell.sh ju stop
View Log
- $ ./julia-box-shell.sh jupyter log
- $ ./julia-box-shell.sh ju log
Then open the URL in the web browser (http://localhost:8888/?token=333....2e885e597195
)
$ ./julia-box-shell.sh jupyter start
non-network local connections being added to access control list
[I 13:58:31.621 NotebookApp] Writing notebook server cookie secret to /home/eniac/.local/share/jupyter/runtime/notebook_cookie_secret
[I 13:58:31.902 NotebookApp] Serving notebooks from local directory: /work
[I 13:58:31.902 NotebookApp] The Jupyter Notebook is running at:
[I 13:58:31.902 NotebookApp] http://localhost:8888/?token=333e54e39f89f685ed35fcf5711e551c64522e885e597195
... ... ... ... ... ...