Sign inSign up

int128/gitbucket

By int128

Updated over 5 years ago

Yet another GitBucket Docker image

Image
0

6.0K

int128/gitbucket repository overview

GitBucket on Docker and Kubernetes test

A GitBucket Docker image and Kubernetes Helm chart.

This repository is automatically updated to the latest GitBucket by CircleCI.

Docker

docker run -p 8080:8080 -p 29418:29418 int128/gitbucket

You can save your GitBucket data to ./gitbucket persistently as follows:

mkdir -p /data/gitbucket
chown -R 1000:1000 /data/gitbucket
docker run -p 8080:8080 -p 29418:29418 -v /data/gitbucket:/var/gitbucket int128/gitbucket

This image runs as gitbucket user (uid=1000, gid=1000), not root for security reason.

This image exposes the following ports:

  • 8080 - Web service
  • 29418 - SSH access to git repository
Environment variables

You can set the following environment variables:

NameValue
GITBUCKET_HOMEDirectory to store data. Defaults to /var/gitbucket.
GITBUCKET_BASE_URLBase URL. This may be required if container is behind a reverse proxy.
GITBUCKET_DB_URLExternal database URL. Defaults to H2.
GITBUCKET_DB_USERExternal database user.
GITBUCKET_DB_PASSWORDExternal database password.
GITBUCKET_OPTSGitBucket command line options.
JAVA_OPTSJVM options. Defaults to options setting JVM heap by container memory limit. See Dockerfile for more.

Kubernetes Helm

:warning: NOTE: Currently Helm chart is not published due to CI issue. Please build it yourself instead

helm repo add int128.github.io https://int128.github.io/helm-charts
helm repo update
helm install int128.github.io/gitbucket

The Helm chart considers the followings:

  • Mount the persistent volume to /var/gitbucket.
  • Fix owner of /var/gitbucket by the init container.
  • Set readiness probe and liveness probe with access to :8080/signin. It should return 200.
Values

You can set the following values:

NameValue
gitbucket.optionsGitBucket command line options.
javavm.optionsJVM options. Defaults to setting JVM heap by the memory limit. See Dockerfile for more.
externalDatabase.urlThe external database URL. Defaults to H2.
externalDatabase.userThe external database user.
externalDatabase.passwordThe external database password.
externalDatabase.existingSecretName of an existing secret to be used for the database password.
externalDatabase.existingSecretKeyThe key for the database password in the existing secret.
persistentVolume.existingClaimName of an existing Persistent Volume Claim.
persistentVolume.sizeSize of a Persistent Volume Claim for dynamic provisioning. Defaults to 10Gi.
resources.limits.memoryMemory limit. Defaults to 1Gi.
resources.requests.memoryMemory request. Defaults to 1Gi.
ingress.enabledIf true, an ingress is be created.
ingress.hostsA list of hosts for the ingress.
annotationsAdditional annotations. Defaults to {}
labelsAdditional labels. Defaults to {}
environmentAdditional environment variables. Defaults to {}
enableServiceLinksIndicates whether information about services should be injected into pod's environment variables. Defaults to true
useDefaultServiceAccountIndicates whether the default ServiceAccount should be used. Otherwise a ServiceAccount with the name gitbucket.fullname will be created. Defaults to true
runAsNonRootRequire that the container will run with a user with any UID other than 0. Defaults to false
chownDataDirectoryInInitContainerEnable initContainer that will change ownership of data directory to 1000:1000. Defaults to true

External database

You can create a database and user for the GitBucket as follows:

# PostgreSQL
CREATE DATABASE gitbucket;
CREATE USER gitbucket PASSWORD 'gitbucket';
GRANT ALL PRIVILEGES ON DATABASE gitbucket TO gitbucket;

# MySQL
CREATE DATABASE gitbucket;
GRANT ALL PRIVILEGES ON gitbucket.* to gitbucket@'%' identified by 'gitbucket';
FLUSH PRIVILEGES; 

Contributions

This is an open source software licensed under Apache License 2.0. Feel free to open issues and pull requests.

Tag summary

Content type

Image

Digest

Size

125.7 MB

Last updated

over 5 years ago

docker pull int128/gitbucket