Using Docker to build and deploy static websites on Amazon S3. amazon , jekyll , docker , cloud , jenkins , server https://octoperf.com/blog/2016/01/15/deploying-jekyll-using-docker/ OctoPerf ZI Les Paluds, 276 Avenue du Douard, 13400 Aubagne, France +334 42 84 12 59 contact@octoperf.com Devops 243 2021-01-04

Deploying Jekyll using Docker

OctoPerf is JMeter on steroids!
Schedule a Demo

Building and deploying a Jekyll website on Amazon S3

To build the website of Octoperf, our load testing tool, we use Jekyll. I also use it for this website.

It’s great to generate static content, hosted on Amazon S3 like OctoPerf or on Github for this blog. But we had trouble upgrading jekyll to version 3 on our build server. We use plugin that are not yet available for this version. So we had to revert back to 2.5.

Docker to the rescue

The whole process took us time. So I decided to use Docker to build, optimize and deploy our website. Now all we need is Docker installed on our build server and available in Jenkins, the Continuous Integration tool we use.

I wrote a simple script that:

1
2
3
4
5
6
7
8
#!/bin/sh

WORKSPACE=${1:-`pwd`}

docker run --rm -i -p $(docker-machine ip `docker-machine active`):4000:4000 -v=$WORKSPACE:/srv/jekyll jekyll/jekyll:2.5.3 /bin/sh -c "jekyll build"
cd $WORKSPACE/_site
find . -name "*.png" | xargs docker run --rm -v=$WORKSPACE/_site:/source buffcode/docker-optipng -o4
docker run --rm -i -v=$WORKSPACE/_site:/website -v=$WORKSPACE/conf:/config attensee/s3_website push --config-dir /config --site /website

Using Docker, we don’t need to maintain installations of ruby, rvm, gems, jekyll and so on. The build process may take a bit longer, but that’s not a big issue. I even started to use this solution on my laptop, to build the website locally.

Deploying Jekyll using Docker
Tags:
Share:
Want to become a super load tester?
OctoPerf Superman