Dockerfile to compile and run Subsurface

Paul-Erik Törrönen poltsi at poltsi.fi
Fri Dec 16 21:26:17 PST 2016


This might be of some interest. Created it as a result of a discussion 
we had on IRC.

Attached is a dockerfile which uses the latest Fedora (25) docker image, 
installs the required packages to compile Subsurface, and then runs the 
program.

To build your image, you save the attached file in the subsurface source 
directory and execute the following command:

# docker build -t build_subsurface .

The first time will take quite some time since it will a) download the 
fedora image from the Docker repo, and then create the custom image.

After this you start up the container with the following command:

# docker run -ti -v /tmp/.X11-unix:/tmp/.X11-unix -e 
DISPLAY=unix$DISPLAY -v /dev/shm:/dev/shm build_subsurface

So what will happen is that when the container is fired up, it will 
execute the build.sh and then run the newly compiled subsurface.

A couple of limitations:

I've only tried this on Fedora, and on other envs you most probably need 
to have a working X for this (Windows+Xcygwin might work, but I haven't 
tried it yet). The '-v /tmp/.X11-unix:/tmp/.X11-unix' maps the 
X11-socket into the container.

You also need to run 'xhost +' to allow for the opening of the GUI 
window, as well as disabling the selinux (setenforce 0).

Obligatory disclaimer, if this breaks something, you get to keep both 
pieces.

Poltsi
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Dockerfile
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161217/cc2f9cfc/attachment.ksh>


More information about the subsurface mailing list