gpt4 book ai didi

docker-compose - docker compose文件中的gitlab多行配置

转载 作者:行者123 更新时间:2023-12-04 16:08:56 28 4
gpt4 key购买 nike

在 docker-compose.yml 中无法添加到环境变量 GITLAB_OMNIBUS_CONFIG ldap 多行 yaml 配置,因为:

# Add any other gitlab.rb configuration here, each on its own line
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main:
label: 'LDAP'
host: 'ldap.<>.local'
port: 389
uid: 'uid'
bind_dn: 'uid=<>,ou=People,dc=,dc='
password: '<>'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
base: '<>'
attributes:
username: ['uid', 'userid', 'sAMAccountName']
email: ['mail', 'email', 'userPrincipalName']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
EOS

有解决办法吗?

最佳答案

PS:发表评论作为我需要格式化的答案

您尝试过以下吗?

version: '3'
services:
nginx:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main:
label: 'LDAP'
host: 'ldap.<>.local'
port: 389
uid: 'uid'
bind_dn: 'uid=<>,ou=People,dc=,dc='
password: '<>'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
base: '<>'
attributes:
username: ['uid', 'userid', 'sAMAccountName']
email: ['mail', 'email', 'userPrincipalName']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
EOS
image: nginx

它验证正常

$ docker-compose config
services:
nginx:
environment:
GITLAB_OMNIBUS_CONFIG: "gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'\n\
main:\n label: 'LDAP'\n host: 'ldap.<>.local'\n port: 389\n uid: 'uid'\n\
\ bind_dn: 'uid=<>,ou=People,dc=,dc='\n password: '<>'\n encryption: 'plain'\
\ # \"start_tls\" or \"simple_tls\" or \"plain\"\n base: '<>'\n attributes:\n\
\ username: ['uid', 'userid', 'sAMAccountName']\n email: ['mail',\
\ 'email', 'userPrincipalName']\n name: 'cn'\n first_name: 'givenName'\n\
\ last_name: 'sn'\nEOS\n"
image: nginx
version: '3.0'

关于docker-compose - docker compose文件中的gitlab多行配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46566562/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com