Published on

Various Docker environments for convenience

Categorised under

Installation

  • Firstly, ensure you have access to a unix platform, and have Docker installed.
  • If running docker on wsl (non-gui) and using the latex container, ensure that you have a X Server setup, to allow the compiled pdf to be displayed on a pdf viewer (in my case zathura).

Running the container

# Create an alias for the following docker command to launch your current folder in the container. E.g. the following for linux:

alias latex='docker run --rm -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/project -w /project ngxingyu/latex bash'

# Sage math:
alias sagemath='docker run --rm -it -p 8888:8888 -v $(pwd):/project ngxingyu/sagemath bash'

# To launch sage jupyter notebook in the sagemath container, just call `jupyter`
bash
  • Sage container: running
    docker run --rm -it -p 8888:8888 -v $(pwd):/project ngxingyu/sagemath bash
    will launch the current folder in the container, and you can access the sage program using
    sage
    or
    jupyter
    which will launch an instance of a jupyter notebook.

Customisation

  • Simply update the included nvim config / Dockerfile with any specific preferences.
  • The sample Dockerfiles can be found here
  • The line
    ARG VER=1
    in the dockerfile is just to force docker to rerun certain parts of the dockerfile, e.g. git clone, or certain outdated packages, and you can increment the number accordingly.