web:
image: 'gitlab/gitlab-ce:latest'
container_name: gitlab
restart: always
hostname: '10.0.0.117'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://10.0.0.117:9090'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
ports:
- '9090:9090'
- '2224:22'
volumes:
- '/aling/docker/gitlab/config:/etc/gitlab'
- '/aling/docker/gitlab/logs:/var/log/gitlab'
- '/aling/docker/gitlab/data:/var/opt/gitlab'
docker-compose up -d to start GitLabProvided you installed GitLab using docker-compose, all you have to do is run docker-compose pull and docker-compose up -d to download a new release and upgrade your GitLab instance
There are also a limited number of environment variables to configure GitLab. They are documented in the environment variables section of the GitLab documentation
For more options about configuring GitLab please check the Omnibus GitLab documentatio
To access GitLab's configuration file
sudo docker exec -it gitlab /bin/bash
vi /etc/gitlab/gitlab.rb
You can also just edit /etc/gitlab/gitlab.rb
sudo docker exec -it gitlab vi /etc/gitlab/gitlab.rb
docker exec -it openldap /bin/bash
memberof_load_configure.ldif,内容如下:dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
objectclass: top
olcModuleLoad: memberof.la
olcModulePath: /usr/lib/ldap
dn: olcOverlay=memberof,olcDatabase={1}mdb,cn=config
objectclass: olcconfig
objectclass: olcMemberOf
objectclass: olcoverlayconfig
objectclass: top
olcoverlay: memberof
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f memberof_load_configure.ldif。ldapsearch -x -LLL -H ldap:/// -b cn=zenglingyu,ou=users,dc=aling,dc=com dn memberof,如果输出如下表示成功dn: cn=zenglingyu,ou=users,dc=aling,dc=com
memberOf: cn=gitlab,ou=groups,dc=aling,dc=com
1、修改GitLab配置文件/etc/gitlab/gitlab.rb
docker exec -it gitlab /bin/bash
vim /etc/gitlab/gitlab.rb
2、具体配置如下
gitlab_rails['ldap_enabled'] = true
###! **remember to close this block with 'EOS' below**
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: '10.0.0.117'
port: 389
uid: 'uid' # ldap中的User Name属性,可以设置为givenName等作为登录名字
bind_dn: 'cn=admin,dc=aling,dc=com'
password: 'daxue31105'
encryption: 'plain'
verify_certificates: false
active_directory: true
allow_username_or_email_login: false
lowercase_usernames: false
block_auto_created_users: false
base: 'dc=aling,dc=com'
user_filter: 'memberof=cn=gitlab,ou=groups,dc=aling,dc=com' #和phpldapadmin上设置条目一样
# ## EE only
# group_base: 'ou=groups,dc=longma,dc=com'
# admin_group: 'cn=gitlab,ou=groups,dc=longma,dc=com'
# sync_ssh_keys: false
#
# secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
# label: 'LDAP'
# host: '_your_ldap_server'
# port: 389
# uid: 'sAMAccountName'
# bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
# password: '_the_password_of_the_bind_user'
# encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
# verify_certificates: true
# active_directory: true
# allow_username_or_email_login: false
# block_auto_created_users: false
# base: ''
# user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
EOS
Content type
Image
Digest
Size
-
Last updated
about 8 years ago
docker pull 1595225018/gitlab-ce