Coder Social home page Coder Social logo

docker-gitlab's Introduction

What is GitLab?

Version Control on your Server like GitHub but Open Source

  • Git repository management, code reviews, issue tracking, activity feeds, wikis and continuous integration
  • 25,000 users on one server or a highly available active/active cluster, LDAP/AD group sync and audit logging
  • Community driven, 700+ contributors, inspect and modify the source, easy to integrate into your infrastructure
  • GitLab runs on your own servers, if you want to use it without installing, see our free GitLab.com service

https://about.gitlab.com

How to use this image

We assume using a data volume container, this will simplify migrations and backups. This empty container will exist to persist as volumes the 3 directories used by GitLab, so remember not to delete it.

The directories on data container are:

  • /var/opt/gitlab for application data
  • /var/log/gitlab for logs
  • /etc/gitlab for configuration

Create the data container with:

sudo docker run --name gitlab_data --volume /var/opt/gitlab --volume /var/log/gitlab --volume /etc/gitlab genezys/gitlab:7.10.4 /bin/true

After creating this, run GitLab:

sudo docker run --detach --name gitlab_app --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data genezys/gitlab:7.10.4

It might take a while before the docker container is responding to queries. You can follow the configuration process with docker logs -f gitlab_app.

You can then go to http://localhost:8080/ (or http://192.168.59.103:8080/ if you use boot2docker). You can login with username root and password 5iveL!fe. Next time, you can just use sudo docker start gitlab_app and sudo docker stop gitlab_app.

Using Docker Compose

You can download the docker-compose.yml file directly from the project repository. It will create a data container with the 3 volumes and an app container using the volumes of data.

To start the application using its default configuration, just run:

docker-compose up -d

How to configure GitLab

This container uses the official Omnibus GitLab distribution, so all configuration is done in the unique configuration file /etc/gitlab/gitlab.rb.

To access GitLab configuration, you can start an interactive command line in a new container using the shared data volume container, you will be able to browse the 3 directories and use your favorite text editor:

docker run -ti -e TERM=linux --rm --volumes-from gitlab_data ubuntu
vi /etc/gitlab/gitlab.rb

Note that GitLab will reconfigure itself at each container start. You will need to restart the container to reconfigure your GitLab.

You can find all available options in Omnibus GitLab documentation.

docker-gitlab's People

Contributors

genezys avatar krijger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

docker-gitlab's Issues

How to backup and restore the gitlab data?

Hi genezys,

I am a newbie for docker and use your gitlab image now.

After executing the commands:

docker run --name gitlab_data genezys/gitlab:7.5.2 /bin/true
docker run --detach --name gitlab --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data genezys/gitlab:7.5.2 

How to backup and restore the gitlab data? I also post a question in SO, and hope you can help it, thanks very much in advance!

Best Reagrds
Nan Xiao

Not possible to restart

After using the dockerized Gitlab for a couple of days I had to restart the machine. The volumes are mapped onto the host machine. I tried to start the container again, but it failed to start. This is the error I get:

STDERR: psql: FATAL: the database system is starting up
Apr 10 13:40:39 node24.cluster.isd.org docker[14227]: ---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
Apr 10 13:40:39 node24.cluster.isd.org docker[14227]: Ran /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" returned 2

To me it looks like there is a timing issue, postgres isn't yet completely started but something is trying to connect to it.
After this error happened, the containers keeps running. Then I manually executed the CMD from the Docker file from a shell inside the container ('gitlab-ctl reconfigure & /opt/gitlab/embedded/bin/runsvdir-start'). That worked, Gitlab starts successfully.

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.