In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to deploy the Chinese version of Docker-compose with one click". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to deploy the Chinese version of gitlab with one click of Docker-compose".
1. Introduction of gitlab
Gitlab uses ruby on rails, an open source version management system, to implement a self-hosted git project repository, which can be accessed through the web interface for public or private projects. It has features similar to github, the ability to browse source code, manage defects and comments. You can manage the team's access to the warehouse, which is very easy to browse the submitted version and provides 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 reuse code and make it easier to find it later when you need it.
Gitlab is a code repository that is very good at managing code and teamwork among developers. At present, the most widely used is to use jenkins and gitlab to achieve continuous integration and deployment. The official recommended configuration is 2 core cpu and 4G memory, because the overall operation of gitlab includes multiple processes, such as nginx, postgresql, prometheus, redis, and so on.
Second, install docker
1. Install the docker dependency package
[root@gitlab ~] # yum- y install yum-utils device-mapper-persistent-data lvm2
two。 Add docker-ce mirror source and install
1.1) Foreign sources (suitable for friends working abroad)
[root@gitlab ~] # yum-config-manager\-add-repo\ https://download.docker.com/linux/centos/docker-ce.repo
1.2) domestic Ali Yunyuan (suitable for friends working in China)
[root@gitlab ~] # yum-config-manager\-add-repo\ http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
2) download the package information of the server to the local computer and cache it
[root@gitlab ~] # yum makecache fast
3) install docker ce
[root@gitlab ~] # yum-y install docker-ce
4) configure download docker Image Accelerator
Foreign accelerators:
[root@gitlab ~] # curl-ssl https://get.daocloud.io/daotools/set_mirror.sh | sh-s http://bc437cce.m.daocloud.io
Domestic Aliyun accelerator:
Vim / etc/docker/daemon.json# enter the following and save: {"registry-mirrors": [https://9w1hl6qt.mirror.aliyuncs.com]}
5) reload systemctl and automatically and turn on self-starting docker
[root@gitlab ~] # systemctl daemon-reload [root@gitlab ~] # systemctl start docker [root@gitlab] # systemctl enable docker [root@gitlab ~] # docker-- version docker version 18.09.0, build 4d60db4
Third, install docker-compose
Download docker-compose binaries and add execute permissions
[root@gitlab ~] # curl-l https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname-s-uname-M`-o / usr/local/bin/docker-compose% total% received% xferd average speed time time time currentdload upload total spent left speed100 617 0617 00 5900 0--:-0:00:01--:-- 590100 11.2m 100 11.2m 00 498k 00: 00:23 0:00 23-737k [root@gitlab ~] # chmod + x / usr/local/bin/docker-compose [root@gitlab ~] # docker-compose-- versiondocker-compose version 1.23.2 Build 1110ad01
Fourth, install gitlab
1) Edit the yml file of docker-compose
[root@gitlab ~] # mkdir gitlab [root@gitlab ~] # cd gitlab [root@gitlab gitlab] # vim docker-compose.yml version:'2' services: gitlab: image: 'twang2218/gitlab-ce-zh:latest' container_name: "gitlab" restart: unless-stopped privileged: true hostname:' gitlab' environment: tz: 'asia/shanghai' gitlab_omnibus_config: | external_url' http://ip Or the domain name 'gitlab_rails [' time_zone'] = 'asia/shanghai' gitlab_rails [' smtp_enable'] = true gitlab_rails ['smtp_address'] = "smtp.163.com" gitlab_rails [' smtp_port'] = 465 gitlab_rails ['smtp_user_name'] = "xxxxxx@163.com" gitlab_rails [' smtp_password'] = "authorization code" gitlab _ rails ['smtp_domain'] = "163.com" gitlab_rails [' smtp_authentication'] = "login" gitlab_rails ['smtp_enable_starttls_auto'] = true gitlab_rails [' smtp_tls'] = true gitlab_rails ['gitlab_email_from'] =' xxxxxx@163.com' gitlab_rails ['gitlab_shell_ssh_port'] = 22 ports: -' 8181 true gitlab_rails 80'- '8443 opt/gitlab/data:/var/opt/gitlab 443'-'22 opt/gitlab/data:/var/opt/gitlab 22 'volumes:-/ opt/gitlab/config:/etc/gitlab-/ opt/gitlab/data:/var/opt/gitlab-/ opt/gitlab/logs:/var/log/gitlab
Port mapping description and considerations:
Gitlab image officially recommends that container port 80 map host port 8181
Gitlab Image official recommendation Container Port 443 Mapping Host Port 8443
Gitlab image officially recommends container port 22 to map host port 22
The first two lines of ⭐️ cannot be written at the top. If you want to leave each line blank, you can go to the yml file inspection website to check:
As your test is shown in the following figure, the yml file is completely correct:
Here's what I saw on my linux server:
2) create related directories
[root@gitlab gitlab] # mkdir-p / opt/gitlab/ {config,data,logs} [root@gitlab gitlab] # ls-l / opt/gitlab/total 0drwxr-xr-x 2 root root 6 dec 22 12:03 configdrwxr-xr-x 2 root root 6 dec 22 12:03 datadrwxr-xr-x 2 root root 6 dec 22 12:03 logs
The catalog is described as follows:
Config stores gitlab configuration information
Data storage database
Logs Storage Log
3) pull gitlab Chinese version image
[root@gitlab gitlab] # docker pull twang2218/gitlab-ce-zh:latestlatest: pulling from twang2218/gitlab-ce-zh8ee29e426c26: pull complete6e83b260b73b: pull completee26b65fd1143: pull complete40dca07f8222: pull completeb420ae9e10b3: pull completea218309dd589: pull complete5c60fd7ba0ce: pull complete659c2144b5a3: pull complete8289bbac0d0e: pull complete31bbd150e8a7: pull complete9114e78243fa: pull completee242e5cd1314: pull complete0a079dc3f92c: pull completef0e195b09fd2: pull complete6e23346e2f58: pull complete91f00659be69: pull completea1031bcc5b2c: pull completee3074327c7b1: pull completea917618dbe42: pull completedigest: sha256:62686b74c6fca5ece8ed582d03a126c5988423dd8a19ce70e9a22357ffcaf1c8status: downloaded newer image for twang2218/gitlab-ce-zh:latest [root@gitlab gitlab] # docker imagesrepository tag image id created sizetwang2218/gitlab-ce-zh latest 18da462b5ff5 4 months ago 1.61gb
4) launch the container of gitlab
Before starting, you need to modify port 22 of the host. Because the host occupies port 22, the startup of the container will fail because it cannot be mapped, so the modification is as follows:
Vim / etc/ssh/sshd_config
The default modification is on line 17: port 2222
Restart sshd:systemctl restart sshd after modification
[root@gitlab gitlab] # netstat-tulnp | grep 22tcp 0 0 0. 0 tulnp 22 0 0 0: listen 31889/sshdtcp6 0 0:: 2222: listen 31889/sshd
Official launch:
[root@gitlab gitlab] # docker-compose up-dcreating network "gitlab_default" with the default drivercreating gitlab... Done [root@gitlab gitlab] # docker-compose psname command state portsgitlab / assets/wrapper up (healthy) 0.0.0.0assets/wrapper up 22-> 22/tcp, 0.0.0.0docker-compose psname command state portsgitlab 8443-> 443/tcp, 0.0.0.0docker-compose psname command state portsgitlab 8181-> 80/tcp [root@gitlab gitlab] # docker ps-acontainer id image command created status ports names814e559dc728 twang2218/gitlab-ce-zh:latest "/ assets/wrapper" 5 minutes ago up 5 minutes (healthy) 0.0.0.0assets/wrapper up 22-> 22/tcp 0.0.0.0 8181-> 80/tcp, 0.0.0.0VR 8443-> 443/tcp gitlab
5) set gitlab to boot.
[root@gitlab gitlab] # chmod + x / etc/rc.local [root@gitlab gitlab] # ls-l / etc/rc.locallrwxrwxrwx 1 root root 13 dec 3 14:31 / etc/rc.local-> rc.d/rc.local [root@gitlab gitlab] # echo "cd / root/gitlab & & docker-compose up-d" > > / etc/rc.local [root@gitlab gitlab] # tail-1 / etc/rc.localcd / root/gitlab & & docker-compose up-d
6) gitlab management interface
Address: enter the ip or domain name on line 12 of the yml file in the browser
User: root
Password: you need to set the password manually for the first login
Thank you for reading, the above is the content of "how to deploy the Chinese version of gitlab with one click of Docker-compose". After the study of this article, I believe you have a deeper understanding of how to deploy the Chinese version of gitlab with one click of Docker-compose, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.