Docker 部署 Gitlab & LDAP配置
Docker 部署 Gitlab & LDAP配置。

Docker 部署 Gitlab

/data目录下创建如下目录

mkdir -p /data/gitlab/config
mkdir /data/gitlab/logs
mkdir /data/gitlab/data

执行如下脚本启动 Gitlab

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 配置

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

最后修改于 2020-04-03

此篇文章的评论功能已经停用。