GitLab安装文档GitLab是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。GitLab与GitHub的功能相似,通常企业使用GitLab在局域网搭建自己的Git代码管理仓库。1Docker下安装Gitlab拉取gitlab、redis、postgresql,gitlab依赖redis和postgresql。创建postgresql、redis容器:创建gitlab容器:浏览器访问:http://192.168.101.64:8899初次访问需要等待一段时间。2添加公钥Jenkins远程访问GitLab获取源代码,这里需要在GitLab配置公钥。dockerpullsameersbn/redisdockerpullsameersbn/postgresqldockerpullgitlab/gitlab‐ce:latestdockerrun‐‐namepostgresql‐d‐‐privileged=true‐e'DB_NAME=gitlabhq_production'‐e'DB_USER=gitlab'‐e'DB_PASS=password'‐e'DB_EXTENSION=pg_trgm'‐v/home/root/opt/postgresql/data:/var/lib/postgresqlsameersbn/postgresqldockerrun‐‐nameredis‐d‐‐privileged=true‐v/home/root/opt/redis/data:/var/lib/redissameersbn/redisdockerrun‐‐namegitlab‐d‐‐linkpostgresql:postgresql‐‐linkredis:redisio‐‐hostname192.168.101.64‐p10022:22‐p8899:80‐e'GITLAB_PORT=8899'‐e'GITLAB_SSH_PORT=10022'‐e'GITLAB_SECRETS_DB_KEY_BASE=long‐and‐random‐alpha‐numeric‐string'‐e'GITLAB_SECRETS_SECRET_KEY_BASE=long‐and‐random‐alpha‐numeric‐string'‐e'GITLAB_SECRETS_OTP_KEY_BASE=long‐and‐random‐alpha‐numeric‐string'‐e'GITLAB_HOST=192.168.101.64'‐e'SMTP_AUTHENTICATION=login'‐v/home/root/opt/gitlab/data:/home/git/datadocker.io/gitlab/gitlab‐ce1、进入jenkins容器,生成公钥:2、进入GitLab配置公钥:[root@localhostconf]#dockerexec‐itjenkins/bin/bashErrorresponsefromdaemon:Container10f316cedd5be97b499db231054a8505ed3b68c36d72cf0e26bbe253cb8a9615isnotrunning[root@localhostconf]#dockerstartjenkinsjenkins[root@localhostconf]#dockerexec‐itjenkins/bin/bashbash‐4.4#ssh‐keygen‐trsa‐C"mrt_0607@126.com"Generatingpublic/privatersakeypair.Enterfileinwhichtosavethekey(/root/.ssh/id_rsa):Createddirectory'/root/.ssh'.Enterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Youridentificationhasbeensavedin/root/.ssh/id_rsa.Yourpublickeyhasbeensavedin/root/....