DEV Community

Cover image for Video: Develop Jekyll or GitHub Pages using Docker containers
Bill Raymond
Bill Raymond

Posted on

Video: Develop Jekyll or GitHub Pages using Docker containers

All the steps I show you in the video are located at this repo in the README


๐Ÿ‘‹ Novice alert!
I hope you find this video helpful, but I also want to point out I am at best a novice Docker user, so please be easy on me :-)

โ“ What are Jekyll and GitHub Pages?

You may be aware GitHub offers a feature called GitHub Pages, which allows you to host your website for free.

While you can certainly use basic html, css, and javascript, a more powerful option is to use Jekyll, which makes it easier to create a website. One of the nicest features is that you build static sites, but they are blog-aware, so blogging is super easy.

๐Ÿ’ป Jekyll and local development

There is a good chance you would like to build your Jekyll site locally to create, modify, or test the functionality before moving your site to production. Unfortunately, if you want to run Jekyll locally, you will have to install Ruby, Jekyll, and other dependencies.

Worse, if you use different versions of Jekyll, you may need different versions of Ruby on your computer. Getting all of that set up is a hassle and it is something I have struggled with over the last year.

๐Ÿ“ฆ Docker containers: The easier way to develop locally

You can use Docker containers to essentially package up a "local" development environment without having to install Ruby or Jekyll on your computer.

๐Ÿ‘ Benefits of developing in a container

  1. You do not need to install Ruby or Jekyll on your computer. Instead, they reside in the container

  2. Using my method, you can use it with x86 or ARM chipsets (x86 being Intel and ARM being things like Apple Silicon)

  3. Every Jekyll container can have its own version of Ruby and or Jekyll, making it easy to switch from one to another (for example, I use Ruby 3.0.3 and Jekyll 4.2.x for my podcast website and Ruby 2.7 with Jekyl 3.9.2 for my company website)

  4. By using Microsoftโ€™s Remote-Containers extension in VSC, the code you write remains on your computer and runs in the container. That means if you accidentally delete the container, you do not lose your files.

โžก๏ธ Pre-requiresites

While I cover these steps in the video, you will need the following to get started:

  1. A free Docker account, along with the Docker Desktop
  2. A free GitHub account
  3. A free copy of Visual Studio Code
  4. The following two free VSCode extensions:

Docker

Remote-containers

Top comments (2)

Collapse
 
renanfranca profile image
Renan Franca

Thank youuuu! I am a happy GitHub page/Jekyll user and I never had the time to set up my localhost environment!! ๐Ÿ‘๐Ÿ‘๐Ÿ˜Š

Collapse
 
billraymond profile image
Bill Raymond

You are very welcome, and I hope it works out for you. Iโ€™m happy to no longer worry about installing extra software on my local computer!