Sign inSign up

chrisramsay/docker-pelican

By chrisramsay

Updated over 8 years ago

Docker image for running a Pelican blog

Image
0

782

chrisramsay/docker-pelican repository overview

docker-pelican

Intro

A machine for maintaining a Pelican web site with a few extras to handle build tasking using Git, Fabric and GPG.

General Use

Copy the run.sh.tpl file to something else, say, run.sh. Add any items you might want in the .gnupg and .ssh directories. Edit your .gitconfig file as necessary

#!/bin/bash

###
# Add more mounts for your projects after the git/gnupg/ssh ones
# e.g. -v ~/stuff/myproject:/project \

wd=$(pwd)
img=docker-pelican
if docker ps | grep $img | awk '{ print $11 }'
    then
    com=$(docker rm -f $img)
    echo "Removed ${com}"
fi
docker run \
--name $img \
-p 80:8000 \
-v $wd/git/.gitconfig:/root/.gitconfig \
-v $wd/gnupg:/root/.gnupg \
-v $wd/ssh:/root/.ssh \
-v ~/mydir:/project \
-ti \
chrisramsay/$img:latest \
/bin/bash

To run the container:

$ ./run.sh

Edit the run.sh file to add as many extra mount commands as you need.

Build Script

There is a build.sh file packaged here. This is to help with further development of the container. One of a number of possible options must be passed at run time.

build

Runs the standard docker build command with a few build arguments; tags as both verson and latest picking up build version from the VERSION file.

release

Does not execute docker build. Instead modifies the Dockerfile replacing in-place values from the Dockerfile.tmpl with label values. This should be done prior to a tagged release.

restore

Used in order to reinstate the normal Dockerfile for continuing development. Utility function only.

Development Process

  • Create a new release branch
  • Change directory to the build directory
  • Bump the version number in build/VERSION
  • Run $ ./build.sh restore to set up a clean Dockerfile
  • Make any required changes to build/Dockerfile.tmpl
  • Run $ ./build.sh build to build current tag and latest
  • Once all the work is complete, run $ ./build.sh release
  • Merge and tag the release

Tag summary

Content type

Image

Digest

Size

252.8 MB

Last updated

over 8 years ago

docker pull chrisramsay/docker-pelican