Gitlab's docker, found some information, and later discovered that people had already done it, and on GitHub. Recently learned a thought, "Do not make the wheel repeatedly", I here simply follow the document to summarize.
Gitlab is a Web service built on the basis of Ruby on Rails an open source version management system using GIT as a code management tool. Implement a self-hosted Git project repository that can be accessed through a web interface for public or private projects. It features a similar feature to GitHub, with the ability to browse source code, manage defects, and annotate. You can manage the team's access to the warehouse, which makes it easy to browse through the submitted version and provide a file history library. Team members can communicate using the built-in simple chat program (Wall). It also provides a code snippet collection feature that makes it easy to implement code reuse, so you can find it later when you need it.
Docker is an open-source application container engine that allows developers to package their applications and dependencies into a portable container, and then publish them to any popular Linux machine or virtualize them. Containers are completely sandbox-aware, with no interface (like IPhone apps) between them. There is little performance overhead and can be easily run in the machine and data center. Most importantly, they are not dependent on any language, framework including system.
Installing Docker:
# wget-qo-https://get.docker.com/| Sh
Install Docker-gitlab:
Install the corresponding version of the Gitlab image:
# Docker Pull sameersbn/gitlab:8.5.5
If you want to install the latest version, use:
# Docker Pull Sameersbn/gitlab:latest
Start Gitlab:
The quickest way to start is to use Docker-compose:
# wget HTTPS://RAW.GITHUBUSERCONTENT.COM/SAMEERSBN/DOCKER-GITLAB/MASTER/DOCKER-COMPOSE.YML
The configuration of the corresponding service is stored in the Yml file, which can be changed according to the situation; You can use the following command to generate a 64-bit random string for gitlab_secrets_db_key_base
# PWGEN-BSV1 64qs7kxxmx3wrwpfmh3cxfpbncnhpfxsxcgrtjcnmgjmjhwlfvmh4hrmwkc4mmcrc7
-Gitlab_secrets_db_key_base=qs7kxxmx3wrwpfmh3cxfpbncnhpfxsxcgrtjcnmgjmjhwlfvmh4hrmwkc4mmcrc7
In addition Docker-gitlab default to use/home/git/data this directory to hold the code submitted, I changed to my own path:
Volumes:-/srv/docker/gitlab/gitlab:/data/code
To start Gitlab, this process needs to wait for a while:
# Docker-compose up
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7D/51/wKioL1bmLOuwP2wcAAGqLkq-Ouk972.png "style=" float: none; "title=" Gitlab1.png "alt=" Wkiol1bmlouwp2wcaagqlkq-ouk972.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7D/53/wKiom1bmLGayZg90AAJjaBdgDuY925.png "style=" float: none; "title=" Gitlab2.png "alt=" Wkiom1bmlgayzg90aajjabdgduy925.png "/>
Review the startup results after execution is complete:
[email protected]:~# docker ps -a container id IMAGE COMMAND CREATED STATUS PORTS namesaefaf4098b00 sameersbn/gitlab:8.5.5 "/sbin/entrypoint.sh " 13 hours ago     UP 13 HOURS         443/TCP, 0.0.0.0:10022->22/tcp, 0.0.0.0:10080->80/tcp root_gitlab_1a8ed7a4dd879 sameersbn/postgresql:9.4-14 "/sbin/entrypoint.sh" 13 hours ago Up 13 hours 5432/tcp root_postgresql_1a9e519dcb183 sameersbn/redis:latest "/sbin/entrypoint.sh" 13 hours ago Up 13 hours 6379/tcp root_redis_1
If you do not use Docker-compose, you can also manually Launch:
1. Start PostgreSQL:
Docker run--name gitlab-postgresql-d--env ' db_name=gitlabhq_production '--env ' Db_user=gitlab '--env ' DB_PASS=p Assword '--volume/srv/docker/gitlab/postgresql:/var/lib/postgresql sameersbn/postgresql:9.4-14
2. Start Redis:
Docker run--name gitlab-redis-d--volume/srv/docker/gitlab/redis:/var/lib/redis sameersbn/redis:latest
3, start Gitlab:
Docker run--name gitlab-d--link gitlab-postgresql:postgresql--link gitlab-redis:redisio--publish 10022:22--p Ublish 10080:80--env ' gitlab_port=10080 '--env ' gitlab_ssh_port=10022 '--env ' Gitlab_secrets_db_key_base=long-and -random-alpha-numeric-string '--volume/srv/docker/gitlab/gitlab:/home/git/data sameersbn/gitlab:8.5.5
The above command will use 10080 as the Gitlab Web Access port, and 10022 will be the port for the SSH push and pull code. Local can use the browser to open http://localhost:10080 to access Gitlab, the initial login site using the root account, the user name is root, the password is: 5ivel!fe, after login need to change the password immediately.
Landing:
http://localhost:10080
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7D/54/wKioL1bmVi6Slw8_AACm3Z5DaZU617.png "title=" Login.png "alt=" Wkiol1bmvi6slw8_aacm3z5dazu617.png "/> Log in and change the password to be able to manage the project ~
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7D/59/wKiom1bmfofCQdevAACNVtvq3_w606.png "title=" Passw.png "alt=" Wkiom1bmfofcqdevaacnvtvq3_w606.png "/>
This article is from "Jason's blog" blog, please be sure to keep this source http://xujunxian.blog.51cto.com/8614409/1750968
Deploying Docker-gitlab