-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Gollum via Docker
Note: we have stopped using latest tag to avoid confusion that can occur when using this tag name. Please use the versioned tags, or the master
tag for an image that includes the latest features and bugfixes.
A Gollum wiki can be run inside a Docker container on Windows, Mac, or Linux. The official Docker image on Dockerhub for Gollum is gollumwiki/gollum.
For example:
-
docker pull gollumwiki/gollum:master
(latest commit tomaster
branch) -
docker pull gollumwiki/gollum:5.3.3
(specific version) -
docker pull gollumwiki/gollum:5.3
(will pull the latest version from the 5.3 range, e.g. 5.3.3)
The image tagged master
is based on the github master
branch, and is deployed to DockerHub whenever an update to that branch passes the build.
After pulling, the following will allow you to access your wiki at http://127.0.0.1:4567/ on the host machine:
-
docker run --rm -p 4567:4567 -v $(pwd):/wiki gollumwiki/gollum:5.3
-
-v $(pwd):/wiki
tells Docker to use the current working directory as the git repository you want to serve your wiki from - alternatively e.g.
-v /path/to/my/git/repo:/wiki
- add the
-d
flag to the command before the image name (gollumwiki/gollum:tagname
) to run Gollum in the background
-
Any flags after the image name (gollumwiki/gollum:tagname
) will be passed to the gollum
command, so you can use all of Gollum's command line options. For example:
docker run --rm -p 4567:4567 -v $(pwd):/wiki gollumwiki/gollum:master --mathjax --h1-title
An example approach to using Gollum with docker-compose
can be found here.
The following guide is aimed at those who want to create their own image, and assumes a minimal working knowledge of Docker. Note that there are also some ready-to-use 3rd Party Docker images at docker Hub. See below.
If you don't have Docker already installed, Docker Toolbox is a convenient package of the Docker binary, VirtualBox (which is used to house containers) and a GUI called Kitematic. Download the version for your operating system here: https://www.docker.com/docker-toolbox
After Docker installs, choose to launch the Docker Quickstart Terminal which will automatically setup Docker and VirtualBox for the first time.
Be sure to note the IP of the docker virtual machine, if running through VirtualBox!
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 123.456.78.90
For help getting started, check out the docs at https://docs.docker.com
- Create a new folder on your machine to house your Wiki. This guide will assume
~/my-gollum-wiki
- Navigate to the workspace folder and create a new, local Git repository. This is what Gollum will use to save commits.
cd ~/my-gollum-wiki
git init
- If you are not in the
~/my-gollum-wiki
location, then go there first
docker run --rm --name gollum -d -v $(pwd):/wiki -p 4567:4567 gollumwiki/gollum:master
The docker image will be pulled down if necessary, then will go into the background.
Note When running on Windows, the host path may need to be prepended with an extra slash as shown below: Special thanks to (https://github.com/dduportal-dockerfiles/docker-compose/issues/1) for highlighting this issue.
This will bind our current folder as a symlink to the container's /wiki
folder. Note: if Docker is running inside VirtualBox (e.g. on Windows or Mac) then this is the IP of VirtualBox as noted above, not localhost of the OS. See the following discussion on setting up automatic VirtualBox forwarding to localhost: https://forums.docker.com/t/using-localhost-for-to-access-running-container/3148/3
- Access the GUI using the web browser http://127.0.0.1:4567 or the IP:4567 of the VirtualBox host.
There are a couple of ready-to-use Gollum Docker Images to be found at Docker Hub. A quick overview
- suttang/gollum: Plain gollum; ubuntu:14.04; Most stars
- winkapp/docker-gollum: Plain gollum, forked from suttang/gollum, newer. Most pulls.
- genebarker/gollum: Gollum & Apache; Debian 8 (Jessie) with support for HTTP and strict HTTPS (HSTS)
- justbuchanan/gollum-docker: Gollum with Rugged Adapter; Archlinux;
- l3iggs/gollum: Gollum & thin, HTTPS; Archlinux
- pjeby/gollum-portable: Gollum's git author can be configured
- silviof/docker-gollum-wuki: Gollum with yaml config
- heichblatt/gollum: Gollum & Apache
- cloudogu/smeagol: Gollum in JRuby, CAS, SCMManager, Support for Multiple Repos
- schnatterer/gollum-galore: Gollum & Caddy (Other Options: NGINX, Traefik); Alpine; HTTPS, HTTP2, GZIP, BasicAuth, etc. ; Openshift v3 Example;
- adtac/gollum-alpine: Gollum in a simple alpine-based Docker image with nothing extra.
Using Podman in rootless mode on a SELinux-enabled system (e.g. Fedora), you may have to do something like this:
podman pull gollumwiki/gollum:master
podman run --name gollum --rm --security-opt label=disable --userns=keep-id -v "${PWD}":/wiki -p 4567:4567 gollumwiki/gollum:master
--userns=keepid
is needed if using a image built after ad6d910. Check the owner of /wiki
inside the container; it should be www-data
.
Gollum is available in the Community Apps store on Unraid. After installing the Community Apps plugin on your Unraid machine, simply search for "gollum" and select the resulting app (provided by grtgbln's repository). Follow the on-screen instructions to set up the container, including mapping the Web UI port and (optionally) changing the directory to store Gollum data on your system. Out of the box, this does not provide customization; you can manually edit this app template to pass in a config.rb
file (see Docker Compose for example)