Jekyll in Docker
Recently I’ve been playing around with Jekyll to create some simple websites. I’ve used Jekyll in the past and I remember that the set-up was a multi-step process.
Jekyll is a Ruby application that uses several Gems and Bundler. That means installing several dependencies. In my case I don’t have a Ruby development environment already set up, so I would have to install all these packages just to use a static site generator.
Then I found the official Jekyll Docker image.
I already have Docker installed to play around with other containers, so downloading a Jekyll container and using it was as easy as:
docker run --rm --label=jekyll --volume=$(pwd):/srv/jekyll \ -it -p 127.0.0.1:4000:4000 jekyll/jekyll jekyll serve
That’s all there is to it. This command will download the latest Jekyll image and start serving your site. No need to install Ruby, Gem, Bundler, or a bunch of other dependencies.