Skip to content
Branch: master
Find file History
DanNixon Tidy up run script and allow debugging tools
--security-opt seccomp=unconfined is required for many debugging tools
to work properly.
Latest commit 68d1879 Apr 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Tidy up run script and allow debugging tools Apr 18, 2019
docker Ensure is owned by abc Apr 15, 2019 Add script related documentation Apr 16, 2019

Mantid development environment in Docker

Docker container for building, testing and developing Mantid.

Base images and versions

There are images for each base OS:

Typically you'd want to use the latest tag which corresponds to the latest version of the developer package and the latest revision of the paraview-build script for the particular base OS.

If you do need a specific developer package version then they are available as tags. Tags follow the naming convention of devpkg-VER_pv-REV, where VER is the developer package version installed and REV is the Git revision of the paraview-build script used to build ParaView.


The images contain three directories /mantid_src, /mantid_build and /mantid_data which are to be used for the source, build and CMake external data directories respectively. It is recommended to have these directories mounted to locations on the host filesystem. Reasons being:

  • Using your existing SCM, editors, etc. (you modify the code on the host filesystem as you will have probably already been doing)
  • Using common external data for host builds and all container builds
  • Running a container built or packaged Mantid on the host (assuming an appropriate host system and base image)

To ensure file permissions are handled correctly if mapping volumes to your host filesystem you must pass the PUID and PGID environment variables when starting a container, these should be set to your user ID and group ID respectively.

The script can be used to start a container, this script takes four parameters:

./ [os] [source] [build] [external data]

[os] is the image variant you want to use (one of centos7, ubuntuxenial or ubuntubionic).

[source], [build] and [external data] are the volumes which will be mounted as the source (root of the Mantid Git repository), build and CMake external data directories. These can either be paths to the host filesystem or names of Docker volumes.

This will give you a bash shell in the build directory. From here you can run cmake and your build tool of choice just as you would on your host OS. Inside the container you will have the username abc which is a standard (i.e. non-root) user with sudo ability.

The (and scripts may need to be modified to suit your system and the environment that you are running them under. In their current state they are a reasonable default.

All images contain a script ($HOME/ which will perform a sensible CMake configuration ready for building. Of course, this can be done manually if a specific configuration is required, however the script should be inspected to find common paths, etc.


For running GUI parts of Mantid (i.e. MantidPlot and workbench) the easiest option is to use x11docker via

./bin/ [os] [source] [build] [external data] [cmd]

If you don't want to or can't use x11docker then you can try using simple X server mapping (this does not seem to work for the workbench). This is already configured in the script, all that is needed in addition is to allow connections to the host X server.

xhost +
./ [os] [source] [build] [external data]

Python 3

The required packages for building Mantid against Python 3 (as described here) are installed on the Ubuntu Xenial and Bionic images so if you wish to build against Python 3 you need to specify the -DPYTHON_EXECUTABLE=/usr/bin/python3 parameter to cmake and append -python3 to the ParaView directory.

Network proxy

One way to get networking to work over a proxy server is to directly use the host system's networking from Docker. First, one needs to enable port forwarding. On Ubuntu 16.04 this can be done by

sudo sysctl net.ipv4.conf.all.forwarding=1
sudo iptables -P FORWARD ACCEPT

Next, the container has to be launced with the --network host option in docker run command. To actually specify the proxy settings, pass --env http_proxy="" and --env https_proxy="" to the command.

You can’t perform that action at this time.