Skip to main content

Published my first Docker images on Docker Hub (ADR Tools, Sculpin, rst2pdf)

Posted on 20th April 2021

I've used Docker for some time for local development, making use of container images from Docker Hub and creating my own project-specific images, but I hadn't pushed any to my Docker Hub profile for anyone else to use - until now.

I've pushed several images to Docker Hub recently:

  • One for using ADR Tools to work with architectural decision records.
  • Two for generating and serving sites built with the Sculpin static site generator.
  • One for working with rst2pdf that I use for presentation slides, with another image coming for watching and automatically re-compiling the PDF.
Image
My Docker images on Docker Hub

ADR Tools

The ADR Tools image a simple one that allows me to initialise and configure ADR Tools itself as well as creating new ADR documents without needing to install adr-tools locally.

For example:

# Initialise the ADR directory
docker run --rm -v $(pwd):/adr opdavies/adr-tools init

# List the current ADRs.
docker run --rm -v $(pwd):/adr opdavies/adr-tools list

# Create a new ADR.
docker run --rm -v $(pwd):/adr opdavies/adr-tools new 'A new ADR'

Sculpin

The Sculpin image repository contains two images - one for running Sculpin commands such as sculpin content:create page to create a new page, and one for generating and serving the Sculpin site that uses the sculpin generate command to generate and serve the site as well as watching for changes.

# Run a "sculpin" CLI command and "composer install" if needed.
docker run --rm -v $(pwd):/app opdavies/sculpin

# Generate and serve the Sculpin site.
docker run --rm -p 8000:8000 -v $(pwd):/app opdavies/sculpin-serve

I've tested this with some of my own personal and client Sculpin projects, as well as the official Sculpin Blog skeleton.

Image
The Sculpin Blog Skeleton running with the sculpin-serve image

rst2pdf

rst2pdf is a tool that I use primarily for presentation slide decks (I gave a talk about this at one of the PHP South Wales meetups).

The rst2pdf image installs Python and rst2pdf so that I can easily generate the PDF files from reStructuredText input files, including any extra arguments that are required.

# A simple example.
docker run --rm -it -v $(pwd):/rst2pdf rst2pdf input.rst

# An example including some additional arguments.
docker run --rm -it -v $(pwd):/rst2pdf rst2pdf slides.rst -b2 -s main -e preprocess

I'm currently adding an rst2pdf-watch image too, similar to sculpin-watch that will watch the files using nodemon and automatically regenerate the PDF files when files change. I'm not entirely sure of the syntax for this yet but I'll push it to Docker Hub too once I've figured it out and have it working.

About Me

Picture of Oliver

Oliver Davies is a PHP Developer and Linux Systems Administrator based in the UK. He is a Senior Software Engineer at Inviqa and a part-time freelancer specialising in Drupal and Symfony application development.