0

I've read the question titled "How is Docker.io different from a normal virtual machine?", but I'm still not certain how "virtual" docker containers are. For example, in a scientific setting, repeatability is very important. If an image produces a certain result on one machine, will the computation be exactly the same on another if using the same image?

(I don't really know at what level different operating systems, kernels, hardware, or architectures can alter calculations in practice, or at what layer Docker abstracts things, if at all.)

Thanks! :)

Chris Cooper
  • 103
  • 4

2 Answers2

2

Docker is just a management layer around an LXC container, essentially a Linux-flavoured jail.

An LXC container uses the same processor and kernel as the host, but uses it's own libraries (i.e. the libraries inside the container filesystem).

So for repeatability, you need to ensure all those attributes are the same. If you already have an answer for this with respect to LXC containers, it's 100% applicable to Docker containers.

MikeyB
  • 39,291
  • 10
  • 105
  • 189
  • Thanks for the response @MickeyB. Ok, it seems like running it in a virtual machine would be necessary either way for a truly consistent environment. – Chris Cooper Apr 04 '14 at 23:42
1

This really depends on which computations you think of:

  • A operation like "multiple the date by 23" is never idempotent because time changes.
  • If your operation's result depends on specific kernel settings, Docker can't guarantee it to be same across different systems
  • If your operation depends on external, physical factors like network latency even a VM won't help.

That said, one of Docker's main goals is to ease repeatable operations. So in most cases, especially in a scientific setting where I doubt the result of a operation/computation ever depends on kernel settings, Docker seems like a good fit. And you're not the first one using it in such environment: http://bcbio.wordpress.com/2014/03/06/improving-reproducibility-and-installation-of-genomic-analysis-pipelines-with-docker/

Johannes 'fish' Ziemke
  • 1,398
  • 1
  • 12
  • 12