Friday, 27 November 2020

Instructions for using docker in Linux

The phylogenetics practical uses Docker, which means the long list of featured apps are pre-installed in one location and can be re-used, for example in your lab projects. However, there is some set up required. These instructions help explain how to set up on Ubuntu or Debian Linux.

(If these instructions don't work for you, you may have to fall back on installing the apps using the commands implied by the Dockerfile. Instructions for using docker in MacOS are here. If you are using a Windows machine, you will have to do your own research. Please report back any tips on this.)

NB: running Docker requires sudo permissions.

These instructions are courtesy of Nicolas Arning

First, run the following commands in a terminal to update the apt-get installer and install core utilities

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Depending on your linux version type one of

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Followed by

sudo apt-key fingerprint 0EBFCD88

Again, depending on your linux version type one of

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install docker with the command

sudo apt-get install docker-ce docker-ce-cli containerd.io

Next activate the graphical interface by executing

xhost local:root

Finally, run the Docker container as follows:

sudo docker run -v $WDIR:/home -e DISPLAY=$DISPLAY -it --rm --env DISPLAY=unix$DISPLAY  -v /tmp/.X11-unix:/tmp/.X11-unix -v $XAUTH:/root/.Xauthority  --name practical dannywilson/teaching-phylogenetics:march2020

If that all went according to plan, you're ready to start the tutorial.