Docker 部署 Gitlab & LDAP配置

Docker 部署 Gitlab

/data目录下创建如下目录

1
2
3
mkdir -p /data/gitlab/config
mkdir /data/gitlab/logs
mkdir /data/gitlab/data

执行如下脚本启动 Gitlab

1
2
3
4
5
6
7
8
9
docker run --detach \
--publish 8443:443 --publish 8000:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume /data/gitlab/config:/etc/gitlab \
--volume /data/gitlab/logs:/var/log/gitlab \
--volume /data/gitlab/data:/var/opt/gitlab \
-log-driver=none \
beginor/gitlab-ce

LDAP 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main:
label: 'LDAP'
host: '127.0.0.1'
port: 389
uid: 'cn'
bind_dn: 'username'
password: 'password'
encryption: 'plain'
verify_certificates: true
active_directory: true
allow_username_or_email_login: true
lowercase_usernames: false
block_auto_created_users: false
base: 'ou=test,ou=testStaff,dc=test,dc=Auto'
user_filter: ''
attributes:
username: ['uid', 'userid', 'sAMAccountName']
email: ['mail', 'email', 'userPrincipalName']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
EOS
----本文结束 感谢您的阅读----