What are containers?

Containers provide a mechanism for setting up an environment with many software dependencies. They can be simple, with a limited number of simple programmes installed, or can be used to set up complex software. In addition, they allow software from different operating systems to be used natively; an Ubuntu package could be used on a RHEL Linux system without any issues.

Users write scripts in a simple standardised way, and this is primarily bundled with the project, and passed on to other developers in order to give them the same environment to work from when developing software. A built container can also be hosted online freely, which is useful when building the dependencies takes a long time.

These features might seem familiar if you’ve come across Virtual Machines in the past. The primary advantage of containers is that they do not incur the performance penalty that virtual machines do, if they are run on a Linux operating system (in general).

What are containers not?

Containers are not always a great way to distribute scientific software to people who are going to use it, particularly when the code is compiled. This is because hardware variances mean that software has generally got to be compiled for the oldest possible machine it could be used for. This means that for optimal performance, multiple versions of the same container need to be compiled. This is particularly important when running high performance software which runs on supercomputers.

Because of this, making your code run in a container is not ‘enough’ to distribute software; it is still necessary to make a comprehensive list of the dependencies necessary to run the software, with versions. However, it takes the pain out of having multiple developers working in different environments which what may prove to be incompatible versions of dependencies. It also should not be used as a way of avoiding updating scientific software because it now runs everywhere.

  • Host - A physical computer running VM/container.
  • Container - An operating system level virtualised environment in which software is installed.
  • Image - A container which has been saved to a file.
  • Hypervisor - The software which runs a virtual machine.
  • Kernel - Core OS components and functions.

Comparisons with Virtual Machines

As mentioned before, despite not being virtual machines, containers act like them in many ways.

How are containers like VMs?

How are containers not like VMs?

Potential Use Cases for Containers as a Scientist

Consider the following, which are all valid use cases: