New video: Develop Jekyll or GitHub Pages using Docker containers

Getting frustrated with managing versions of Ruby on my computer, I decided to learn about containers and how you can run code directly in them. While I am no expert, I did figure out how to create Docker containers that allow me to run all my code without the need to install Ruby or Jekyll on my computer. I believe this video will work on any computer (Apple, Windows, Linux), but I only tested on an Apple Silicon Mac. I hope you find this video useful!

Benefits of developing in a container

  1. You do not need to install Ruby or Jekyll on your computer. Instead, it lives inside a 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.

Related repo

I wrote down all the instructions for this video in the readme file for the same repo I create in the video. If you want to clone the repo and try it for yourself, you can follow those instructions as well.

you should check out Gitpod and see if you can do a video on that. I have played with it and gotten it to work other than live reloading the browser when you make a change.

It would address the same thing - make the dev environment separate than your device and then you can also run it from any device without having anything installed - even VSC - as it all runs in the browser.

@rdyar I looked into them, but they have been super buggy. For example, I would run bundle install, and all would be fine, then it would just sit there at some random file saying it was installing, and it never completed the process. That is just one example. Sometimes a bundle exec jekyll serve would just sit there and again never run (or maybe it would if I waited, but the wait is way too long if that is the case).

I will keep an eye on them, though, and perhaps at another time, they will work well enough for me to use the product, and if so, I will create a video. Thank you for the recommendation!

that’s a bummer. I don’t use bundler and didn’t have any real issues. I tried to get one their peeps to do something jekyll specific but they never responded back to me.

Then you can use a one liner to bring the server up for development and testing: docker-compose up.

An example of it in action is here: GitHub - SharpeTronics/sharpetronics.github.io: The web application for SharpeTronics homepage.