Micah P. Dombrowski / Aug 20 2019

Julia 0.7 Environment


Build a Minimal Julia 0.7 Environment

We'll base our environment off of our Minimal Bash image. Note that the Julia version is set as an environment variable on the runtime.

Minimal Julia 0.7
Minimal Julia 0.7 (Bash)
exporting environment
The exported environment has changes that need to be saved.
Type: Nextjournal
Environment Variables:
Download this environment as a Docker image from:

Download the archive and signatures.


echo "Downloading ${FILEURL}."

curl -fL -o julia.sha256 \
curl -fL -o julia.tar.gz.asc "${FILEURL}.asc"
curl -fL -o julia.tar.gz "${FILEURL}"

echo `grep $FILENAME julia.sha256 | cut -d " " -f1` > j256sig

Check the signatures to verify our download.

sha256=`cat j256sig`
echo "${sha256} *julia.tar.gz" | sha256sum -c -

export GNUPGHOME="$(mktemp -d)"
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$JULIA_GPG"
gpg --batch --verify julia.tar.gz.asc julia.tar.gz
command -v gpgconf > /dev/null && gpgconf --kill all
rm -rf "$GNUPGHOME" julia.tar.gz.asc julia.sha256

Install and remove the archive.

mkdir -p "$JULIA_PATH"
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1
rm julia.tar.gz j256sig

And verify it runs.

julia -v

The JSON package is required to run on Nextjournal. Newest JSON.jl uses xparse from newer versions of Parsers.jl, which we can't install. —mpd, 20 Aug 2019

julia -e 'using Pkg; pkg"up; add JSON@0.20.0; pin JSON; build; precompile"'

Build a 'Default' Julia 0.7 Environment

We'll add a number of packages as well as the libraries and support programs required by them. The major packages installed are JuliaPlots along with the GR and PlotlyJS backends, and the DataFrames, CSV, and HDF5 data-handling packages.

Some Julia packages require gcc to compile, so first we'll install that, as well as various required tools and libraries.

apt-get -qq update
apt-get install --no-install-recommends \
  imagemagick libhdf5-dev hdf5-tools mesa-utils \
  build-essential gfortran cmake automake libtool libltdl-dev pkg-config \
  libxt6 libxrender1 libgl1-mesa-glx libqt5widgets5 `# for GR` \
  libhttp-parser2.7.1 `# for PlotlyJS`
apt-get clean
rm -r /var/lib/apt/lists/* # Clear package list so it isn't stale

Plots needs FFmpeg to create animations, so we'll install a 64-bit static build from an install package we download in the Appendix.


mkdir -p $IDIR
cd $IDIR

tar -Jxf 
--strip 1 for ex in $IDIR/{ffmpeg,ffmpeg-10bit,ffprobe,qt-faststart}; do ln -s $ex /usr/local/bin/ done

Install packages. Fixing Plots at v0.19.3, the current final 0.7 version. This seems to clear up some other version/dep issues. —mpd, 16 Dec 2018. Added JSON version here, because pinning apparently doesn't work. —mpd, 20 Aug 2019.

using Pkg
pkg"add SoftGlobalScope DataFrames JLD CSV CSVFiles Netpbm NRRD MeshIO HDF5 MAT FileIO JSExpr JSON@v0.20.0 CSSUtil StatsBase StatsPlots Observables Interact WebSockets HTTP Blink WebIO PlotlyJS PlotlyBase RecipesBase GR Plots#v0.19.3 ImageCore ImageShow ImageMagick Colors BenchmarkTools FixedPointNumbers IJulia"