What is this repo?
The basis for myBinder instances working with an "overclocked" Julia system.
Julia so far only offers precompilation, which just caches the result of Julia’s lowering pass — which is at most half of the total compilation cost.
The advantage of PackageCompiler is that you can pre-pay the entire compilation cost. Which helps a ton, especially for heavy packages like Plots.
Click the badge below to spin up your own Binder instance. That's it!
Note: This link is pegged to a static tag of the repo (
v0.2.1). It's much faster that way, as otherwise you will have to wait for Binder to build a new Docker image (if there's new activity in your repo.)
How do I add new packages to "bake in?"
Edit the following line in the Dockerfile:
RUN julia -e "using Pkg; pkg\"add PackageCompiler Plots DataFrames GR Query\"; using PackageCompiler; compile_incremental(:Plots, :DataFrames, GR, :Query, force = true)"
That is, first add the package in the
pkg\"add PackageCompiler Plots...\", and then add it to the
compile_incremental(:Plots, :DataFrames, ...)
How do I add new packages that aren't baked-in?
Edit the next line of the Dockerfile:
RUN julia -e "using Pkg; pkg\"add IJulia Parameters\"; pkg\"precompile\""
What repository files get added to the Dockerfile?
Everything that's not listed in the
How do I build set up myBinder instances from my own image?
Once you have a Dockerfile, set it up in a public GitHub repository, and follow the instructions at the myBinder website.
Notes about Deployment:
These images are much faster if you use static tags (i.e., tag a release, and then have your binder link refer to that release). For example, the link above begins
https://mybinder.org/v2/gh/arnavs/compiled-binder-example/v0.2.0?. Note that, if you don't do this, it will build a new image every time you commit to the repository.
To set a particular file as the entrypoint, you can add a string to the end of the URL. For example, we added
Speed is variable. Repositories that are used a lot get unintentional speed bosts, because their Docker images are already cached on each Binder server (but, this only helps if you use static tags/have unchanging content!)
It helps to keep your Dockerfile small. This involves bundling as many commands as make sense in individual
RUNstatements (to minimize additional layers), and following hygiene (e.g., after we add our Ubuntu packages, we run
You can file an issue or PR on this repository if there are any problems. Or contact me at