Skip to content

sbamin/sitebuilder

Repository files navigation

sitebuilder

Docker image: sbamin/sitebuilder

Docker image to build static websites managed via Jekyll, Hugo(https://gohugo.io) or MkDocs framework.

For Jekyll framework, your site's Gemfile should match version requirements given in Gemfile. Also, avoid putting Gemfile.lock in the build repository as it will be generated at the time of build.

For MkDocs, docker image is using mkdocs-material theme developed by Martin Donath.

NOTE: docker image with a latest tag may have breaking changes and may not work with one or more of static site engines if your code is not compatible with the latest version. Please check Release page for breaking changes, if any. If so, you may try using previous version of a docker image.

Serve local for testing

WARN: Only for testing purpose. Container by default will expose ports 4000, 8000, and 1313. Depending on firewall settings in the host machine, this may expose website contents to intranet or public at the exposed port(s). Make sure that firewall is secure enough and stop server immediately after testing.

## First go to root directory containing respective website repository.

## mkdocs, preview at http://0.0.0.0:4000
docker run -v "$(pwd):/web" --rm -P -p 127.0.0.1:4000:4000 sbamin/sitebuilder mkdocs serve -a 0.0.0.0:4000

## jekyll, preview at http://0.0.0.0:4000
docker run -v "$(pwd):/web" --rm -P -p 127.0.0.1:4000:4000 sbamin/sitebuilder jekyll serve --watch --host=0.0.0.0 -c _devconfig.yml -d _sitelocal

## hugo, preview at http://0.0.0.0:4000
docker run -v "$(pwd):/web" --rm -P -p 127.0.0.1:4000:4000 sbamin/sitebuilder hugo server --bind 0.0.0.0 --port 4000

Build local

Build website will be under <root_directory>/site.

## mkdocs
docker run -v "$(pwd):/web" --rm sbamin/sitebuilder mkdocs build --clean --site-dir site

## jekyll
docker run -v "$(pwd):/web" --rm sbamin/sitebuilder jekyll build -c _config.yml --destination site

## hugo
docker run -v "$(pwd):/web" sbamin/sitebuilder hugo --cleanDestinationDir --destination site

Get singularity SIF image

If you prefer using singularity SIF image, run following command to get an updated SIF image.

singularity run docker://sbamin/sitebuilder:latest

END