Dockerizing this Chirpy-Themed Jekyll Site Step by Step
This document outlines the steps to set up a Dockerized development environment for this portfolio (Chirpy-themed Jekyll site) on Debian Linux. The steps here were tested on a Parallels virtual machine (VM) running Ubuntu 24.04.2 LTS
.
Setting Up Ruby 3.2.2
This section details setting up Ruby 3.2.2
, a foundational step for consistent Docker image builds.
Installation Steps
Update Package Lists:
1
sudo apt update
Install Git and
rbenv
:Git for repository management,
rbenv
for precise Ruby version control.1
sudo apt install git rbenv
Initialize
rbenv
:Configuring
rbenv
for Ruby version management.1
rbenv init
Remove System-Installed
ruby-build
:Removes potential system-installed
ruby-build
to ensure we use the latest version from Git.1
sudo apt remove ruby-build
Installs
ruby-build
from Git for the latest Ruby definitions:1
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
Install Required Development Libraries:
1
sudo apt install libffi-dev zlib1g-dev libyaml-dev libreadline-dev ruby-dev
Install Ruby 3.2.2: Install the exact Ruby version required by the Jekyll site.
1
rbenv install 3.2.2
- Set the global Ruby Version:
1
rbenv global 3.2.2
Verify Ruby Installation: Confirm the correct Ruby version.
1
ruby -v
Install Bundler: Install Bundler for managing Ruby gem dependencies.
1
gem install bundler
Cloning Repository and Installing Dependencies
This section covers cloning the repository and installing its dependencies.
Installation Steps
Clone the Jekyll Repository:
1
git clone git@github.com:wilfrantz/wilfrantz.github.io.git
Install Jekyll Dependencies:
cd into the repository and run the command below to install required Ruby gems specified in the
Gemfile
.1
bundle install
Building the Docker Image
This section details building the Docker image. At the time of writing, jekyll/jekyll:latest
resulted in an architecture mismatch error on arm64
systems, use rosetta ubuntu image on silicon MacOS systems. Dockerfile
use ubuntu:latest
:
Build the Docker Image:
1
sudo docker build -t jekyll-local .
Run the Docker Container:
1
sudo docker run -p 4000:4000 -v "$PWD:/site" jekyll-local
- Open a web browser on a device on your home network.
- Enter the server’s IP address and port 4000 (e.g.,
http://10.211.55.43:4000
).