A Jekyll Image with prereqs installed, default config, GitHub pages support, and compose file.
https://github.com/derailed-dash/jekyll
This is a modified Docker container image, based on Jekyll/Jekyll.
github-pages
gemwebrick
, which is required by Jekyll, but no longer installed by default in Ruby.github-pages-unscramble
, to allow use of plugins that aren't on the GitHub Pages whitelist, locally.jekyll-spaceship
, which provides various processors, like table, mathjax, mermaid_config.docker.yml
to allow us to run locally, and expose on localhost:4000.docker-compose.yml
for starting and serving your site through the container; it automatically sets up environment variables and volumes.Pre-reqs: that we have created the folder where our site will live, and that this folder is the CWD.
Run the container interactively:
docker run -e "JEKYLL_ENV=docker" --rm -it -v "${PWD}:/srv/jekyll" -p 127.0.0.1:4000:4000 daz502/jekyll:0.1 sh
From the interactive session, we can perform some initial configuration:
# Initial site creation, if you don't yet have a site folder
jekyll new my_site
# Or, if you have a site folder, but no source in it...
jekyll new --force --skip-bundle .
# Copy our default config into the working volume; preserve file attributes (i.e. jekyll owner)
# This includes a default Gemfile. We need this before we run the bundle install
cp -p ../config/* .
(The Gemfile specifies the dependencies that Ruby should install.)
At this point, make any changes you want to make to the configuration files. For example, you may wish to update the Gemfile to update jekyll and github-pages gem versions, or add any custom plugins we want to use.
If you need to update versions for GitHub Pages support, these pages will be helpful:
You may also want to update your _config.yml
, for your basic site settings.
Now complete the site build from the container session:
bundle install # installs dependencies and write the Gemfile.lock
bundle update
exit
Note that you may also want to run the above commands if you have corrupted your local Jekyll docs configuration.
Simply launch the container as follows:
docker compose up
Note that this configuration monitors for changes and automatically updates the site content.
Other notes:
.env
file in folder where your docker-compose.yml lives, and use this to configure your GitHub token, e.g.JEKYLL_GITHUB_TOKEN=whatever
If the image is ever updated, we'll want to update the tag and push to docker.io. E.g.
# build
docker image build -t daz502/jekyll:ver .
docker tag daz502/jekyll:ver daz502/jekyll:latest
# push
docker push daz502/jekyll:ver
docker push daz502/jekyll:latest
Version | Changes |
---|---|
0.3 | Moved default content to a defaults folder, so that we don't accidentally replace the README.md in an existing site when building a new site |
0.2 | First working version |