LDAP as env vars on dockerized 8.9-community

Hello,

I was updating our SonarQube instance to new LTS version and choose to do it with docker-compose.
Everything works fine except LDAP authentication.

I pass the parameters for LDAP through environment vars in compose file:

sonarqube:
  image: {{ sonarqube_image_version }}
  container_name: {{ project_name }}
  networks:
  {{ project_name }}-net:
  depends_on:
    - database
  environment:
    SONAR_JDBC_URL: jdbc:postgresql://{{ ansible_hostname }}.{{ ansible_domain }}:{{ postgres_port }}/{{ postgres_database_name }}
    SONAR_JDBC_USERNAME: {{ postgres_user_name }}
    SONAR_JDBC_PASSWORD: {{ postgres_user_password }}
    SONAR_WEB_PORT: {{ sonarqube_tcp_port }}
    HTTP_PROXYHOST: {{ proxy_host}}
    HTTP_PROXYPORT: {{ proxy_port}}
    HTTPS_PROXYHOST: {{ proxy_host}}
    HTTPS_PROXYPORT: {{ proxy_port}}
    LDAP_URL: {{ ldap_url }}
    LDAP_REALM: {{ ldap_realm }}
    LDAP_BINDDN: {{ ldap_binddn }}
    LDAP_BINDPASSWORD: {{ ldap_bind_password }}
    LDAP_USER_BASEDN: {{ ldap_user_basedn }}
    LDAP_USER_REQUEST: {{ ldap_user_request }}
    LDAP_USER_REALNAMEATTRIBUTE: {{ ldap_user_real_name_attribute }}
    LDAP_USER_EMAILATTRIBUTE: {{ ldap_user_email_attribute }}
    SONAR_TELEMETRY_ENABLE: "false"
  restart: 'unless-stopped'

With the above configuration I am not able to login to sonarqube.
If I add the LDAP vars to /opt/sonarqube/conf/sonar.properties and restart the container its working.

Am I doing something wrong?

1 Like