Skip to content
🐳 GitHub Pages server in a docker
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
README.md
docker-entrypoint.sh

README.md

Docker Image Docker Pulls Docker Stars

Quick Start

Run the GitHub Pages server docker image. Considering /path/to/my/project the directory containing the GitHub Pages sources:

docker run --name my-github-pages \
    --detach --restart unless-stopped \
    --publish 4000:4000 \
    --volume /path/to/my/project:/var/lib/github-pages \
    jmlemetayer/github-pages

GitHub Metadata

The GitHub Metadata plugin (i.e. site.github) works as is if the directory is also a git repository and there is a valid git remote named origin.

Authentication

For some fields, like cname, you need to authenticate yourself. Begin by generating a new personal access token on GitHub.com:

Now you can use the JEKYLL_GITHUB_TOKEN environment variable:

docker run --name my-github-pages \
    --detach --restart unless-stopped \
    --publish 4000:4000 \
    --volume /path/to/my/project:/var/lib/github-pages \
    --env JEKYLL_GITHUB_TOKEN=123mytoken321 \
    jmlemetayer/github-pages

Overrides

You can override the site.repository by using the PAGES_REPO_NWO environment variable:

docker run --name my-github-pages \
    --detach --restart unless-stopped \
    --publish 4000:4000 \
    --volume /path/to/my/project:/var/lib/github-pages \
    --env PAGES_REPO_NWO=username/repo-name \
    jmlemetayer/github-pages
You can’t perform that action at this time.