A Gnuplot Docker Image

TL;DR

If you are intrigued by Gnuplot (e.g. after reading Gnuplot Headache, you might be interested into a Docker image for it.

The dibs file is pretty straightforward:

# vim: ts=2 sts=2 sw=2 et ai :
---
name: gnuplotter

packs:
  basic:
    type: git
    origin: https://github.com/polettix/dibspack-basic.git

actions:
  default:
    - from: alpine:3.9
    - pack: basic
      path: package/apk
      args: ['--suexec', 'gnuplot', 'ttf-freefont', 'ffmpeg', 'su-exec']
      commit:
        entrypoint: ['/suexec', '--reference', '/mnt', '--']
        cmd: ['/bin/sh', '-l']
        workdir: /mnt
    - image_name: polettix/gnuplotter
      tags: ['latest', '1.1']

As usual, invoked as:

$ dibs -A

and yes, I’m regretting not making alien mode the default one.

If you want to use the gnuplotter image, the suggestion is to mount a host directory (e.g. $PWD) on /mnt inside the container:

$ docker run --rm -itv "$PWD:/mnt" polettix/gnuplotter

This has two effects:

  • it allows you to use an editor in the host, and get the output files easily, and
  • it allows the container to set the user inside the container to match the one of the mounted directory, so that you will not have permission problems.

All of this thanks to suexec, which you might remember from Documentation for suexec.

That’s all folks!

Update: updated dibs.yml file with new way of installing modules and suexec.


Comments? Octodon, , GitHub, Reddit, or drop me a line!