Skip to content

hest-hq/gitiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitiles

A container image for Gitiles, Google's simple browser for Git repositories.

The image builds Gitiles from source with Bazel and ships a small wrapper that generates a config from environment variables at start-up. It is a standard OCI image — the examples below use podman, but docker accepts the same subcommands and flags.

Image

Published to GitHub Container Registry:

ghcr.io/hest-hq/gitiles:latest
ghcr.io/hest-hq/gitiles:<tag>

Usage

Mount a directory containing bare Git repositories at /home/git and expose port 8080:

podman run --rm -it \
  -p 8080:8080 \
  -v /srv/git:/home/git:Z,ro \
  -e BASE_GIT_URL=git@example.com \
  -e SITE_TITLE=example.com \
  ghcr.io/hest-hq/gitiles:latest

Then browse to http://localhost:8080.

The :Z relabel on the volume is for SELinux hosts (Fedora, RHEL); drop it on other systems. :ro is optional but recommended — Gitiles never writes to the repository directory.

Environment variables

The default entrypoint writes /gitfiles.config from these variables:

Variable Required Purpose
BASE_GIT_URL yes Clone URL prefix shown in the UI (a trailing : is added).
SITE_TITLE yes Site title, also used as canonicalHostName.
GA_ID no Google Analytics property ID (prepended with UA-). Omit for an internal server.

Custom config

To supply your own Gitiles config instead, mount it into the container and pass its path as the first argument:

podman run --rm -it \
  -p 8080:8080 \
  -v /srv/git:/home/git:Z,ro \
  -v $PWD/gitiles.config:/etc/gitiles.config:Z,ro \
  ghcr.io/hest-hq/gitiles:latest /etc/gitiles.config

Building locally

podman build -t gitiles .   # or: docker build -t gitiles .

The image uses a multi-stage build: Gitiles is compiled from source with Bazel in the first stage, and only the resulting uber-jar plus static resources are copied into a slim eclipse-temurin:17-jre runtime stage.

Pass --build-arg GITILES_VERSION=vX.Y.Z to pin a different upstream revision.

Credits

The original single-stage Dockerfile and start.sh that this image is derived from are from Jessie Frazelle's dockerfiles repo, distributed under the MIT License. This version rebuilds them as a multi-stage image on a slim Alpine JRE base.

Gitiles itself is Copyright Google and is distributed under the Apache License, Version 2.0 — see COPYING upstream.

License

Apache License, Version 2.0. See LICENSE and NOTICE.

About

Gitiles container image — simple Git repository browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors