A docker images which can be used to directly deploy jekyll pages from a public git repository.
1.9K
This is a fork from https://github.com/DonMcNamara/dockerfiles/tree/master/dockerjekyllpages which is built at https://hub.docker.com/r/dmcnamara/dockerjekyllpages/
This repo is built at https://hub.docker.com/r/whitegecko/dockerjekyllpages/
This is a docker image to build a Jekyll page from a Git repository. This is essentially githubpages in a docker image. This docker image uses nginx, Jekyll, uwsgi and supervisor.
The git repository URL is passed as an environment variable to the docker image.
The environment variable is named REPO, also a branch to build can be specified using the variable BRANCH.
Alternatively the container can be linked to a volume at /data/jekyll/source which contains the Jekyll page to build.
If you want to clone private git repositories your might want to forward your private SSH key resp. the SSH Authentication Socket.
Per default the SSH_AUTH_SOCK environment variable is set to /var/run/ssh-agent.sock in this image thus you only have to mount the hosts SSH_AUTH_SOCK to the container by adding the argument -v "$SSH_AUTH_SOCK:/var/run/ssh-agent.sock".
If you don't have an SSH_AUTH_SOCK running on the docker host you can also mount the id_rsa-file e.g. with -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro.
In the case that you are mounting a private key rather then using the hosts SSH agent it is a good idea to generate a key without password.
Usually you also want to tell the known hosts to the container so it doesn't prompt for the decision.
You can do this by mounting the hosts known_hosts-file with -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts:ro.
To initiate a rebuild, you can use your browser to load http://yourserver/cgi/buildsite.sh
For an automatic build, you can set up a git service hook that posts to that URL on a git push. Your site will rebuild when you push changes to your repository.
Per default the site will be hosted on port 80. This is especially useful in combination with a proxy container e.g. the one from jwilder.
If you want to serve you site locally you can map it e.g. to port 8080:
sudo docker run -p 8080:80 -e REPO=[YOUR REPO URL HERE] -e BRANCH=[YOUR BRANCH] whitegecko/dockerjekyllpages
If you experience that ./buildsite.sh never ends and if you run it manually you get the following output:
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
You are using a ssh remote URL.
There are two solutions:
known_hosts-file as explained above in the "Use SSH Authentication"-sectionContent type
Image
Digest
Size
170.7 MB
Last updated
almost 8 years ago
docker pull whitegecko/dockerjekyllpages