edrixs and docker¶
Run edrixs in a docker container¶
To make life easier, we have built a docker image based on Ubuntu Linux (18.04) for edrixs, so you don’t need to struggle with the installation anymore. The docker image can be used on any OS as long as the docker application is available. Follow these steps to use the docker image:
Once Docker is running, create a directory to store data in your host OS and launch a container to run edrixs:
mkdir /dir/on/your/host/os # A directory on your host OS docker pull edrixs/edrixs # pull latest version docker run -it -u rixs -w /home/rixs -v /dir/on/your/host/os:/home/rixs/data edrixs/edrixs
it will take a while to pull the image from Docker Hub for the first time, while, it will launch the local one very fast at the next time.
-u rixsmeans using a default user
rixsto login the Ubuntu Linux, the password is
-v /dir/on/your/host/os:/home/rixs/datameans mounting the directory
/dir/on/your/host/osfrom your host OS to
/home/rixs/dataon the Ubuntu Linux in the container.
In the container, you can play with edrixs as you are using an isolated Ubuntu Linux system. After launching the container, you will see
/home/rixsdirectory. If you want to save the data from edrixs calculations to your host system, you need to work in
cd /home/rixs/data cp -r ../edrixs_examples . Play with edrixs ...
Note that any changes outside
/home/rixs/datawill be lost when this container stops. You can only use your host OS to make interactive plots. Use
sudo apt-get installto install software packages if they are needed.
exitin the container to exit. You can delete all the stopped containers by:
docker rm $(docker ps -a -q)
If you do not need the image anymore, you can delete it by:
docker rmi edrixs/edrixs
Connect to docker python session with Jupyter¶
Jupyter is a popular way to integrate your code with rich output including plots. You may find this working mode particularly useful for exploratory work, when you try many different approaches to calculations or analysis.
To use this follow the steps above, but pass an additional command
-p 8888when you launch the container i.e.:
docker run -it -p 8888:8888 -u rixs -w /home/rixs -v /dir/on/your/host/os:/home/rixs/data edrixs/edrixs_interactive
the container will automatically launch a jupyter session as:
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root
Jupyterlab provides access to a unix terminal, which you can create via File > New > Terminal. We suggest changing the terminal shell type by issuing the command
bashin the terminal.