In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how Docker-compose deploys gitlab". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how Docker-compose deploys gitlab" can help you solve the problem.
Docker-compose deployment gitlab
1. Install docker
Install the necessary tools
The copy code is as follows:
[root@vm_10_14_centos ~] # yum- y install yum-utils device-mapper-persistent-data lvm2
Add docker-ce mirror source and install
[root@vm_10_14_centos ~] # yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo[root@vm_10_14_centos ~] # yum makecache fastness [root @ vm_10_14_centos ~] # yum- y install docker-ce [root@gitlab ~] # yum makecache fastness [root @ vm_10_14_centos ~] # yum- y install docker-ce [root@vm_10_14_ Centos ~] # systemctl start docker [root @ vm_10_14_centos ~] # systemctl enable dockercreated symlink from / etc/systemd/system/multi-user.target.wants/docker.service to / usr/lib/systemd/system/docker.service.
Add docker Mirror acceleration
[root@vm_10_14_centos ~] # vim / etc/docker/daemon.json {"registry-mirrors": ["https://9w1hl6qt.mirror.aliyuncs.com"]}[root@vm_10_14_centos ~] # systemctl daemon-reload [root@vm_10_14_centos ~] # systemctl restart docker [root @ vm_10_14_centos ~] # rpm-qa docker [root@vm_10_14_centos ~] # rpm-qa docker-cedocker-ce-18. 09.0-3.el7.x86_64 [root@vm_10_14_centos ~] # docker-- versiondocker version 18.09.0 Build 4d60db4 [root @ vm_10_14_centos ~] # docker versionclient: version: 18.09.0 api version: 1.39 go version: go1.10.4 git commit: 4d60db4 built: wed nov 7 00:48:22 2018 os/arch: linux/amd64 experimental: falseserver: docker engine-community engine: version: 18.09.0 api version: 1.39 (minimum version 1.12) go version: go1.10.4 git commit: 4d60db4 built: wed nov 7 00:19:08 2018 os/arch: linux/amd64 experimental: false
2. Install docker-compose
Download docker-compose binaries and add execute permissions
[root@vm_10_14_centos ~] # 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 current dload upload total spent left speed100 617 0617 00 959 0--:-958100 11.2m 100 11.2m 00 1824k 00: 00:06 0:00:06-2422k [root @ vm_10_14_centos ~] # chmod + x / usr/local/bin/docker-compose [root@vm_10_14_centos ~] # docker-compose-- versiondocker-compose version 1.23.2 Build 1110ad01
3. Install gitlab
(1) Edit the yml file of docker-compose
[root@vm_10_14_centos ~] # mkdir gitlabs [root @ vm_10_14_centos ~] # cd gitlab/ [root @ vm_10_14_centos gitlab] # vim docker-compose.yml version: '2'services: gitlab: image:' twang2218/gitlab-ce-zh:11.1.4' container_name: "gitlab" restart: unless-stopped privileged: true hostname: 'gitlab' environment: tz:' asia/shanghai' gitlab_omnibus_ Config: | external_url 'http://129.204.133.242' gitlab_rails [' time_zone'] = 'asia/shanghai' gitlab_rails [' smtp_enable'] = true gitlab_rails ['smtp_address'] = "smtp.aliyun.com" gitlab_rails [' smtp_port'] = 465 gitlab_rails ['smtp_user_name'] = "kimasd102419@aliyun.com" # use your own aliyun mailbox gitlab_rails [' smtp_ Password'] = "axbc1kof" gitlab_rails ['smtp_domain'] = "aliyun.com" gitlab_rails [' smtp_authentication'] = "login" gitlab_rails ['smtp_enable_starttls_auto'] = true gitlab_rails [' smtp_tls'] = true gitlab_rails ['gitlab_email_from'] =' kimasd102419@aliyun.com' gitlab_rails ['gitlab_shell_ssh_port'] = 22 ports: -' 80 smtp_tls' 80'- Volumes:-/ opt/gitlab/config:/etc/gitlab-/ opt/gitlab/data:/var/opt/gitlab-/ opt/gitlab/logs:/var/log/gitlab
(2) create relevant directories
[root@vm_10_14_centos gitlab] # mkdir / opt/gitlab/ {config,data,logs}-p [root @ vm_10_14_centos gitlab] # ls-l / opt/gitlab/total 12drwxr-xr-x 2 root root 4096 dec 8 11:35 configdrwxr-xr-x 2 root root 4096 dec 8 11:35 datadrwxr-xr-x 2 root root 4096 dec 8 11:35 logs
(3) pull gitlab Chinese version image
[root@vm_10_14_centos gitlab] # docker pull twang2218/gitlab-ce-zh:11.1.411.1.4: pulling from twang2218/gitlab-ce-zh8ee29e426c26: pull complete 6e83b260b73b: pull complete e26b65fd1143: pull complete 40dca07f8222: pull complete b420ae9e10b3: pull complete a218309dd589: pull complete 5c60fd7ba0ce: pull complete 659c2144b5a3: pull complete 8289bbac0d0e: pull complete 31bbd150e8a7: pull complete 9114e78243fa: pull complete 0b97fa2153bc: pull complete 308c7e15be6a: pull complete b7f31b8e487d: pull complete cbbb6dec5000: pull complete 0241c9ad6a16: pull complete 7fa6f0b53edd: pull complete 1c2861e152b2: pull complete 0536f3466f66: pull complete digest: sha256 : 3c2372e3285e6d6933ddebb5ee3ae0c4bbf7cb235084e54d33d7f0ddf4813c4astatus: downloaded newer image for twang2218/gitlab-ce-zh:11.1.4 [root@vm_10_14_centos gitlab] # docker image lsrepository tag image id created sizetwang2218/gitlab-ce-zh 11.1.4 1935cc9f8798 4 months ago 1.61gb
(4) launch the container of gitlab
[root@vm_10_14_centos gitlab] # docker-compose up-dcreating network "gitlab_default" with the default drivercreating gitlab... Errorerror: for gitlab cannot start service gitlab: b'driver failed programming external connectivity on endpoint gitlab (9308ca74b8491c556263eac9fb9b0abcb25258d9e2df5733fc4d9143d6b18dcc): error starting userland proxy: listen tcp 0.0.0.0 error starting userland proxy 22: bind: address already in use'error: for gitlab cannot start service gitlab: b'driver failed programming external connectivity on endpoint gitlab (9308ca74b8491c556263eac9fb9b0abcb25258d9e2df5733fc4d9143d6b18dcc): error starting userland proxy: listen tcp 0.0.0.015 22: bind: address already in use'error: encountered errors while bringing up the project. [root@vm_10_14_centos gitlab] # vim / etc/ssh/sshd_config [root@vm_10_14_centos gitlab] # systemctl restart SSHD [root @ vm_10_14_centos gitlab] # netstat-tulnp | grep 22tcp 00 0.0.0.0 etc/ssh/sshd_config 60022 0.0.0.0 * listen 4044/sshd
It should be noted here that since the gitlab container needs port 22 and cannot conflict with the host, the listening port of the host's sshd service needs to be modified.
[root@vm_10_14_centos gitlab] # docker-compose psname command state ports- -- gitlab / assets/wrapper up (healthy) 0.0.0.0 healthy 22-> 22/tcp 0.0.0.0 443-> 443/tcp, 0.0.0.0 VR 80-> 80/tcp
(5) set gitlab to boot.
[root@vm_10_14_centos gitlab] # chmod + x / etc/ rc.local [root @ vm_10_14_centos gitlab] # ls-l / etc/rc.locallrwxrwxrwx. 1 root root 13 jul 7 16:43 / etc/rc.local-> rc.d/ rc.local [root @ vm_10_14_centos 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: http://129.204.133.242
Account number: root
Password: first login settings
This is the end of the introduction to "how Docker-compose deploys gitlab". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.