[](https://dashboard.tutum.co/stack/deploy/)
# sameersbn/gitlab:7.13.2
- [Introduction](#introduction)
- [Version](#version)
- [Changelog](Changelog.md)
- [Contributing](#contributing)
- [Issues](#issues)
- [Announcements](https://github.com/sameersbn/docker-gitlab/issues/39)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Persistence](#persistence)
- [Database](#database)
- [PostgreSQL (Recommended)](#postgresql)
- [External PostgreSQL Server](#external-postgresql-server)
- [Linking to PostgreSQL Container](#linking-to-postgresql-container)
- [MySQL](#mysql)
- [Internal MySQL Server](#internal-mysql-server)
- [External MySQL Server](#external-mysql-server)
- [Linking to MySQL Container](#linking-to-mysql-container)
- [Redis](#redis)
- [Internal Redis Server](#internal-redis-server)
- [External Redis Server](#external-redis-server)
- [Linking to Redis Container](#linking-to-redis-container)
- [Mail](#mail)
- [SSL](#ssl)
- [Generation of Self Signed Certificates](#generation-of-self-signed-certificates)
- [Strengthening the server security](#strengthening-the-server-security)
- [Installation of the SSL Certificates](#installation-of-the-ssl-certificates)
- [Enabling HTTPS support](#enabling-https-support)
- [Configuring HSTS](#configuring-hsts)
- [Using HTTPS with a load balancer](#using-https-with-a-load-balancer)
- [Establishing trust with your server](#establishing-trust-with-your-server)
- [Installing Trusted SSL Server Certificates](#installing-trusted-ssl-server-certificates)
- [Deploy to a subdirectory (relative url root)](#deploy-to-a-subdirectory-relative-url-root)
- [OmniAuth Integration](#omniauth-integration)
- [Google](#google)
- [Twitter](#twitter)
- [GitHub](#github)
- [GitLab](#gitlab)
- [BitBucket](#bitbucket)
- [SAML](#saml)
- [External Issue Trackers](#external-issue-trackers)
- [Mapping host user and group](#mapping-host-user-and-group)
- [Piwik](#piwik)
- [Available Configuration Parameters](#available-configuration-parameters)
- [Maintenance](#maintenance)
- [Creating Backups](#creating-backups)
- [Restoring Backups](#restoring-backups)
- [Automated Backups](#automated-backups)
- [Amazon Web Services (AWS) Remote Backups](#amazon-web-services-aws-remote-backups)
- [Rake Tasks](#rake-tasks)
- [Upgrading](#upgrading)
- [Shell Access](#shell-access)
- [References](#references)
# Introduction
Dockerfile to build a [GitLab](https://about.gitlab.com/) container image.
## Version
Current Version: `7.13.2`
# Contributing
If you find this image useful here's how you can help:
- Send a Pull Request with your awesome new features and bug fixes
- Help new users with [Issues](https://github.com/sameersbn/docker-gitlab/issues) they may encounter
- Support the development of this image with a [donation](http://www.damagehead.com/donate/)
# Issues
Docker is a relatively new project and is active being developed and tested by a thriving community of developers and testers and every release of docker features many enhancements and bugfixes.
Given the nature of the development and release cycle it is very important that you have the latest version of docker installed because any issue that you encounter might have already been fixed with a newer docker release.
For ubuntu users I suggest [installing docker](https://docs.docker.com/installation/ubuntulinux/) using docker's own package repository since the version of docker packaged in the ubuntu repositories are a little dated.
Here is the shortform of the installation of an updated version of docker on ubuntu.
```bash
sudo apt-get purge docker.io
curl -s https://get.docker.io/ubuntu/ | sudo sh
sudo apt-get update
sudo apt-get install lxc-docker
```
Fedora and RHEL/CentOS users should try disabling selinux with `setenforce 0` and check if resolves the issue. If it does than there is not much that I can help you with. You can either stick with selinux disabled (not recommended by redhat) or switch to using ubuntu.
You may also set `DEBUG_ENTRYPOINT=true` to enable debugging of the entrypoint script, which could help you pin point any configuration issues.
If using the latest docker version and/or disabling selinux does not fix the issue then please file a issue request on the [issues](https://github.com/sameersbn/docker-gitlab/issues) page.
In your issue report please make sure you provide the following information:
- The host distribution and release version.
- Output of the `docker version` command
- Output of the `docker info` command
- The `docker run` command you used to run the image (mask out the sensitive bits).
# Prerequisites
Your docker host needs to have 1GB or more of available RAM to run GitLab. Please refer to the GitLab [hardware requirements](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md#hardware-requirements) documentation for additional information.
# Installation
Pull the image from the docker index. This is the recommended method of installation as it is easier to update image. These builds are performed by the **Docker Trusted Build** service.
```bash
docker pull sameersbn/gitlab:7.13.2
```
You can also pull the `latest` tag which is built from the repository *HEAD*
```bash
docker pull sameersbn/gitlab:latest
```
Alternately you can build the image locally.
```bash
git clone https://github.com/sameersbn/docker-gitlab.git
cd docker-gitlab
docker build --tag=$USER/gitlab .
```
# Quick Start
The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/).
```bash
wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml
docker-compose up
```
Alternately, you can manually launch the `gitlab` container and the supporting `postgresql` and `redis` containers by following this three step guide.
Step 1. Launch a postgresql container
```bash
docker run --name gitlab-postgresql -d \
--env 'DB_NAME=gitlabhq_production' \
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
--volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
sameersbn/postgresql:9.4-2
```
Step 2. Launch a redis container
```bash
docker run --name gitlab-redis -d \
--volume /srv/docker/gitlab/redis:/var/lib/redis \
sameersbn/redis:latest
```
Step 3. Launch the gitlab container
```bash
docker run --name gitlab -d \
--link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
--publish 10022:22 --publish 10080:80 \
--env 'GITLAB_PORT=10080' --env 'GITLAB_SSH_PORT=10022' \
--volume /srv/docker/gitlab/gitlab:/home/git/data \
sameersbn/gitlab:7.13.2
```
*Please refer to [Available Configuration Parameters](#available-configuration-parameters) to understand `GITLAB_PORT` and other configuration options*
__NOTE__: Please allow a couple of minutes for the GitLab application to start.
Point your browser to `http://localhost:10080` and login using the default username and password:
* username: **root**
* password: **5iveL!fe**
You should now have the GitLab application up and ready for testing. If you want to use this image in production the please read on.
*The rest of the document will use the docker command line. You can quite simply adapt your configuration into a `docker-compose.yml` file if you wish to do so.*
# Configuration
## Persistence
GitLab is a code hosting software and as such you don't want to lose your code when the docker container is stopped/deleted. To avoid losing any data, you should mount a volume at,
* `/home/git/data`
SELinux users are also required to change the security context of the mount poi