This project contains a Docker image that can be used as a base image to create a new Docker image customised for your environment.
-
Clone this repository.
-
Build the Docker image.
docker build -t <your-docker-repo>/centos-gitlab-ce:latest .
-
Deploy the image to your repository
docker push <your-docker-repo>/centos-gitlab-ce:latest
Run the image locally by enabling the required ports and volumes as below (replace host directories with your own).
docker run -i -t -v /Users/tyrell/git/centos-gitlab-ce/host_directories/etc/gitlab:/etc/gitlab -v /Users/tyrell/git/centos-gitlab-ce/host_directories/var/opt/gitlab:/var/opt/gitlab -v /Users/tyrell/git/centos-gitlab-ce/host_directories/var/log/gitlab:/var/log/gitlab -p 127.0.0.1:80:80/tcp -p 127.0.0.1:443:443/tcp tyrell/centos-gitlab-ce:12.0.3-ce.0.el7.x86_64 /bin/bash
Once the image is running, use docker exec to enter into the image for verification.
Tyrells-MacBook-Air:~ tyrell$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ff0c9f9f6f1 tyrell/centos-gitlab-ce:12.0.3-ce.0.el7.x86_64 "assets/container-en…" About a minute ago Up About a minute 127.0.0.1:80->80/tcp, 22/tcp, 127.0.0.1:443->443/tcp modest_mestorf
Tyrells-MacBook-Air:~ tyrell$ docker exec -it 6ff0c9f9f6f1 /bin/bash
oc login
oc new-project gitlab
sh openshift/create-openshift-app.sh
The openshift/create-openshift-app.sh script uses the image hosted at https://hub.docker.com/r/tyrell/centos-gitlab-ce and creates the required Persistent Volume Claims in Openshift for persistent storage volume mounts.
Delete the Openshift application using;
oc delete all -l app=gitlab-ce
Run /assets/wrapper
to initialise GitLab for the first time. This script creates all the necessary dependencies and database schemas etc.
- conf/gitlab.rb is copied into the image during build.
- conf/sysctl.rb is a modified version to prevent all the sysctl kernel parameter modifications performed during reconfigure. It is expected that PostgreSQL will be running on its own container during a proper deployment.
Copyright (c) 2017 Tyrell Perera tyrell.perera@gmail.com Licensed under the MIT license.