1. OpenLDAP

1.1. Docker

docker run  \
    --rm \
    -p 389:389 \
    -p 636:636 \
    --env LDAP_ORGANISATION="My Company" \
    --env LDAP_DOMAIN="my-company.com" \
    --env LDAP_ADMIN_PASSWORD="MyPassword" \
    --volume /tmp/openldap/data:/var/lib/ldap \
    --volume /tmp/openldap/config:/etc/ldap/slapd.d \
    --name openldap-server \
    osixia/openldap

1.2. Docker Compose

  1. Create file docker-compose.yaml

    version: '3'
    
    networks:
        devtools-ecosystem:
            driver: bridge
    
    services:
        openldap:
            image: osixia/openldap
            container_name: openldap-server
            restart: "no"
            hostname: my-company.com
            environment:
                - LDAP_ORGANISATION="My Company"
                - LDAP_DOMAIN="my-company.com"
                - LDAP_ADMIN_PASSWORD="MyPassword"
                - LDAP_TLS_CRT_FILENAME="my-ldap.crt"
                - LDAP_TLS_KEY_FILENAME="my-ldap.key"
                - LDAP_TLS_CA_CRT_FILENAME="the-ca.crt"
            ports:
                - "389:389"
                - "636:636"
            networks:
                - devtools-ecosystem
            volumes:
                - /tmp/openldap/data:/var/lib/ldap
                - /tmp/openldap/config:/etc/ldap/slapd.d
                - /tmp/openldap/certs:/container/service/slapd/assets/certs
    
  2. Run Jenkins

    docker-compose up
    
  3. Run Jenkins in background (daemon)

    docker-compose up -d
    

1.3. Connect

docker exec openldap ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

1.4. GUI

docker run -p 6443:443 \
    --env PHPLDAPADMIN_LDAP_HOSTS=openldap \
    --detach \
    --rm \
    --name openldap-gui \
    osixia/phpldapadmin