Github Pages in Docker with One Line Command
It's remarkably simple to run your Jekyll site with Github Pages and Docker locally. I'll never install rvm again!
I run this blog on Github Pages. In the past, when writing posts, I’ve previewed my blog by installing Ruby through RVM and then doing the good old bundle exec jekyll serve
dance.
However, I recently reinstalled Ubuntu, and I didn’t have Ruby. I’ve been using Docker a lot at work, and decided that this would be the perfect way to avoid having to set up Ruby again. Turns out someone’s already done the work of making a Github Pages Docker image and it can be run in one line:
It’s especially important to note the --host 0.0.0.0
part. Without it, you won’t be able to access the running Jekyll server on localhost:4000
.
I’ll never install Ruby again*!
* Unless, of course, I need to.
Comments
Let me know what you think!