Skip to content

Running Fluidity with Docker

Tim Greaves edited this page Nov 11, 2015 · 8 revisions

Install Docker

See the comprehensive instructions provided by Docker at http://docs.docker.com/engine/installation/

Running a Fluidity example

To test your Fluidity container, you might want to check out Fluidity on your host system, then run the 'top hat' example using the container:

git clone https://github.com/fluidityproject/fluidity.git
cd fluidity/examples/top_hat/
docker run -v $PWD:/rundir -w="/rundir" -a stdout -t fluidity/release make preprocess run

In the above case:

  • docker run starts a container and prepares to run a command in it
  • -v hostdir:containerdir exposes hostdir to the container as containerdir
  • -w="containerdir" makes containerdir the working directory
  • -a stdout sends stdout from the container to your terminal
  • -t fluidity/release uses the fluidity/release container from dockerhub
  • make preprocess run is the command executed in the container

Matching your username/ID inside the container

Note that by default the container runs as the user 'fluidity' with ID 1000, and any files written by processes in the container will have that ID. You may well want to modify your container to run with your username and user ID, with the use of a simple Dockerfile such as:

FROM fluidity/release
USER root
RUN adduser --disabled-password --gecos "" -u 61745 annesmith
USER annesmith

Then build the updated container in the directory containing the Dockerfile with:

docker build -t my-fluidity-container .

And run in your container with:

docker run -v /data/fluidity-input:/rundir -a stdout -t my-fluidity-container fluidity -V myjob.flml

Files will now be written with user ID 61745.

Other release flavours

If you prefer to work in a CentOS environment, two alternative release environments are provided in the containers 'fluidity/release:centos6' and 'fluidity/release:centos7'.

Buildbot images

Whilst not intended for general use, developers may find the containers generated by the Fluidity buildbot useful for debugging or other development work. These are available in the 'fluidity/buildbot' repo on Docker hub. -dev-build provides the underlying environment for trusty, centos6, and centos7, whilst -latest-pretest gives the image which the latest tests were run on, and -latest-tested gives the image which last passed all tests. For example, a set of images for the standard trusty build would be:

fluidity/buildbot:trusty-dev-build
fluidity/buildbot:trusty-standard-latest-pretest
fluidity/buildbot:trusty-standard-latest-tested

Branch testing will by default push containers to fluidity/buildbot unless otherwise requested.

Release image generation

At present, release images are hand-rolled after new packages are released, using Dockerfiles in the FluidityProject github docker repository.

Fluidity Dockerfiles

All Dockerfiles used in the FluidityProject testing and release suite are hosted in branches of the 'docker' repository in FluidityProject github.

Clone this wiki locally