###获取docker 镜像
参考文档:https://docs.gitlab.com/omnibus/docker/#run-the-image
镜像名称gitlab/gitlab-ce:latest
docker pull gitlab/gitlab-ce:latest
mkdir /srv/gitlab/{config,data,logs} -p
docker run --detach --publish 443:443 --publish 80:80 \
--name gitlab --restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
--privileged=true \
gitlab/gitlab-ce:latest
访问http://192.168.66.113即可
###中文版镜像
docker run --detach --publish 443:443 --publish 80:80 \
--name gitlab --restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
--privileged=true \
beginor/gitlab-ce
###配置ldap用户登录
$ vim /srv/gitlab/config/gitlab.rb
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: '192.168.90.144'
port: 389
uid: 'uid'
method: 'plain' # "tls" or "ssl" or "plain"
bind_dn: 'cn=xxx,dc=xxx,dc=com'
password: 'xxx'
active_directory: true
allow_username_or_email_login: true
base: 'dc=xxx,dc=com'
user_filter: ''
EOS
ldap配置
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: 'xxxx'
port: 3268
uid: 'xxxxx'
bind_dn: 'xxxxxx'
password: 'xxx'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
verify_certificates: true
ca_cert: ''
ssl_version: ''
active_directory: true
allow_username_or_email_login: true
block_auto_created_users: false
base: ''
user_filter: ''
attributes:
username: ['uid', 'userid', 'sAMAccountName']
email: ['mail', 'email', 'userPrincipalName']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
## EE only
group_base: ''
admin_group: ''
sync_ssh_keys: false
EOS
#重启gitlab容器
docker restart gitlab
#查看容器日志
docker logs gitlab
###登陆web页面
###LDAP账号登陆
###web控制台页面