
glauth/glauth-pluginsglauth Docker镜像是一个轻量级的LDAP认证服务器实现,采用Go语言开发。它提供了传统LDAP服务器的核心功能,但具有更简单的配置和部署流程,适合需要快速搭建LDAP服务的场景。
bashdocker run -d -p 389:389 --name glauth glauth/glauth
bashdocker run -d -p 389:389 -v /path/to/your/glauth.conf:/app/glauth.conf --name glauth glauth/glauth
yamlversion: '3' services: glauth: image: glauth/glauth ports: - "389:389" - "636:636" volumes: - ./glauth.conf:/app/glauth.conf - ./certs:/app/certs restart: always
glauth使用简单的INI格式配置文件,主要包含以下部分:
ini[global] debug = false port = 389 tls port = 636 backend = file cors allowed origins = * [database] # 数据库后端配置(当backend设置为sqlite、mysql或postgres时需要) [ldap] base dn = dc=glauth,dc=com name format = %s filter format = (&(objectClass=posixAccount)(uid=%s)) # 用户和组定义 [[users]] name = john uidnumber = 5001 gidnumber = 5001 cn = John Doe givenname = John sn = Doe mail = *** password = mysecret homephone = *** [[groups]] name = developers gidnumber = 5001 members = john, jane
glauth Docker镜像支持以下环境变量:
GLAUTH_CONFIG: 配置文件路径,默认为/app/glauth.confGLAUTH_DEBUG: 是否启用调试模式,默认为falseGLAUTH_PORT: LDAP服务端口,默认为389GLAUTH_TLS_PORT: LDAP TLS服务端口,默认为636bashdocker pull glauth/glauth
创建一个名为glauth.conf的配置文件,内容如下:
ini[global] debug = false port = 389 tls port = 636 backend = file [ldap] base dn = dc=example,dc=com [[users]] name = alice uidnumber = 5001 gidnumber = 5001 cn = Alice Smith givenname = Alice sn = Smith mail = *** password = securepassword homephone = *** [[groups]] name = admins gidnumber = 5001 members = alice
bashdocker run -d -p 389:389 -v $(pwd)/glauth.conf:/app/glauth.conf --name glauth glauth/glauth
使用ldapsearch测试连接:
bashldapsearch -x -h localhost -p 389 -b "dc=example,dc=com" -D "cn=Alice Smith,dc=example,dc=com" -w "securepassword"
ini[global] debug = false port = 389 tls port = 636 backend = file cert file = certs/cert.pem key file = certs/key.pem
bashdocker run -d -p 389:389 -p 636:636 -v $(pwd)/glauth.conf:/app/glauth.conf -v $(pwd)/certs:/app/certs --name glauth glauth/glauth
bashldapsearch -x -H ldaps://localhost:636 -b "dc=example,dc=com" -D "cn=Alice Smith,dc=example,dc=com" -w "securepassword"
glauth支持多种数据库后端,以下是使用MySQL后端的示例配置:
ini[global] debug = false port = 389 backend = mysql [database] dbname = glauth host = mysql-host port = 3306 user = glauthuser password = glauthpass sslmode = disable
yamlversion: '3' services: glauth: image: glauth/glauth ports: - "389:389" - "636:636" volumes: - ./glauth.conf:/app/glauth.conf - ./certs:/app/certs depends_on: - mysql environment: - GLAUTH_DEBUG=true restart: always mysql: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=rootpassword - MYSQL_DATABASE=glauth - MYSQL_USER=glauthuser - MYSQL_PASSWORD=glauthpass volumes: - mysql-data:/var/lib/mysql restart: always volumes: mysql-data:
bashdocker logs glauth
bashdocker pull glauth/glauth docker stop glauth docker rm glauth docker run -d -p 389:389 -v $(pwd)/glauth.conf:/app/glauth.conf --name glauth glauth/glauth




manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务