Code Monkey home page Code Monkey logo

docker-gitlab's Introduction

Gitlab Docker Image

Quick start

git clone https://github.com/genshen/docker-gitlab.git
cd docker-gitlab
docker pull genshen/gitlab-ce:latest
docker pull genshen/gitlab-pages:latest
mkdir -p data/gitlab data/gitlab-pages data/postgresql data/redis data/gitlab-pages/shared
docker-compose run --rm gitlab init # initialize gitlab database
docker-compose up

And then open browser, visit http://localhost:10080.

Build docker images

cd builder
docker build --rm -t gitlab-base-builder .
cd ../gitlab-shell
docker build --rm -t gitlab-shell-builder .
cd ../gitlab-workhorse
docker build --rm -t gitlab-workhorse-builder .
cd ../gitaly
docker build --rm -t gitlab-gitaly-builder .
cd ../gitlab
docker build --rm -t gitlab-builder .
# building intermediate images finished.
cd ../gitlab-pages
docker build --rm -t genshen/gitlab-pages .
cd ../
docker build --rm -t genshen/gitlab-ce .

or you can build all images using all-in-one Dockerfile.

docker build --file all-in-one/Dockerfile --rm -t genshen/gitlab-ce .
docker build --file gitlab-pages/Dockerfile --rm -t genshen/gitlab-pages .

Notes for configuration.

Database

For currently, only postgresql is supported.

In docker compose, 127.0.0.1 (and its reserved DNS name localhost) always refers to the current container, never the host. So, in database config (file config/database.yml), the host term should set to postgresql container name. So is the redis server hostname.

gitlab-workhorse

In entrypoint of this gitlab image, the path of file .gitlab_workhorse_secret is set to be ${GITLAB_WORKHORSE_DIR}/.gitlab_workhorse_secret (${GITLAB_WORKHORSE_DIR} is usually /home/git/gitlab-workhorse).
if .gitlab_workhorse_secret file path is not configured correctly, the clone will return http 500 error when using http(s) protocol.
You should also config .gitlab_workhorse_secret file path in workhorse.secret_file in config file config/gitlab.yml.

data map

The symbolic link of following directories are created to ${GITLAB_DATA_DIR}, ${GITLAB_LOG_DIR} or ${GITLAB_CONFIG_DIR}.

default, ${GITLAB_HOME} is /home/git; ${GITLAB_DIR} is ${GITLAB_HOME}/gitlab; ${GITLAB_PAGES_DATA_DIR} is /gitlab/gitlab-pages, ${GITLAB_DATA_DIR} is /gitlab/data.

gitlab source location (symbolic link) => real location
sshd host key ${GITLAB_DATA_DIR}/ssh
${GITLAB_HOME}/repositories ${GITLAB_DATA_DIR}/repositories
${GITLAB_HOME}/.ssh ${GITLAB_DATA_DIR}/.ssh
${GITLAB_DIR}/builds ${GITLAB_DATA_DIR}/builds
${GITLAB_DIR}/public/uploads ${GITLAB_DATA_DIR}/public/uploads
${GITLAB_DIR}/shared/artifacts ${GITLAB_DATA_DIR}/shared/artifacts
${GITLAB_DIR}/shared/lfs-objects ${GITLAB_DATA_DIR}/shared/lfs-objects
${GITLAB_DIR}/shared/registry ${GITLAB_DATA_DIR}/shared/registry
${GITLAB_DIR}/shared/pages ${GITLAB_PAGES_DATA_DIR}
${GITLAB_DIR}/tmp ${GITLAB_DATA_DIR}/tmp
${GITLAB_DIR}/log ${GITLAB_LOG_DIR}/gitlab/
${GITLAB_SHELL_DIR}/gitlab-shell.log ${GITLAB_LOG_DIR}/gitlab/gitlab-shell.log
sshd log ${GITLAB_LOG_DIR}/sshd.log
${GITLAB_DIR}/config ${GITLAB_CONFIG_DIR}

Run gitlab

Run docker-compose up command, the gitlab-workhorse will listen on tcp port 8181. You can also change environment variable WORKHORSE_LISTEN_NETWORK to "unix" (default value is "tcp") to let gitlab-workhorse listen unix socket ${GITLAB_DATA_DIR}/tmp/sockets/gitlab.socket.

Gitlab-Pages

Image genshen/gitlab-ce does not containe gitlab-pages. If you need gitlab-pages, you can pull genshen/gitlab-pages. You should then follow this link to config your gitlab-pages.

docker-gitlab's People

Contributors

genshen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.