有一个简单的方法来configurationDocker的私人registry2.0与LDAP?

我试图遵循这个指示:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04

在我的RHEL7(3.10内核)机器上。 但是,它可能是连接到LDAP的更快,最简单的方法吗? 我有私人registry2.0启动并运行与TLS自签名证书。 我可以从外部服务器上推拉图像,但仍然在寻找快速的选项,以使我的命令能够使registry运行LDAP。

现在我用这个命令运行我的Docker:

docker run -d -p 5000:5000 --restart=always --name Docker_registry -v /data/docker_registry:/var/lib/registry -v /etc/docker/certs.d:/etc/docker/certs.d -e REGISTRY_HTTP_TLS_CERTIFICATE=/etc/docker/certs.d/dl-tools.ocnet.local.crt -e REGISTRY_HTTP_TLS_KEY=/etc/docker/certs.d/dl-tools.ocnet.local.key registry:2 

你能帮我吗? 如果我告诉nginx使用LDAP,我得到这个错误:

 nginx_1 | 2016/05/31 10:37:31 [emerg] 1#1: unknown directive "ldap_server" in /etc/nginx/conf.d/registry.conf:31 nginx_1 | nginx: [emerg] unknown directive "ldap_server" in /etc/nginx/conf.d/registry.conf:31 docker_nginx_1 exited with code 1 

似乎需要一个模块来使用ldap,但如何添加它,当nginx只是一个docker的容器?

编辑:

我也试过这个方法: https : //github.com/cesanta/docker_auth

但是当我使用这个命令时:

 docker run --rm -it --name docker_auth -p 5001:5001 -v /data/docker_registry/docker/docker_auth-master:/config:ro -v /var/log/docker_auth:/logs cesanta/docker_auth:stable /data/docker_registry/docker/docker_auth-master/docker-compose.yml 

我得到了这个错误:

 F0601 10:42:30.862161 1 main.go:167] Failed to load config: could not read /data/docker_registry/docker/docker_auth-master/docker-compose.yml: open /data/docker_registry/docker/docker_auth-master/docker-compose.yml: no such file or directory 

之后,我把所有的configuration推到/ tmp,然后从那里开始,但是我得到了同样的问题(即使我有docker-compose.yml文件的777权限)。

我的docker-compose.yml如下所示:

 server: addr: :5001 certificate: /data/docker_registry/docker/certs/docker-registry.crt key: /data/docker_registry/docker/certs/docker-registry.key token: issuer: Acme auth server expiration: 900 ldap_auth: # Addr is the hostname:port or ip:port addr: "ldaps://ldap.xxxxxx.com:636/OU=ROOT,DC=xxxxx,DC=local?sAMAccountName?sub?(&(memberOf:1.2.840.113556.1.4.1941:=cn=xx_DOCKER_USERS,OU=xxxx,OU=Groups,OU=GLOB000,OU=Global,OU=ROOT,DC=xxxxx,DC=local)(objectClass=person))" SSL # Setup tls connection method to be # "" or "none": the communication won't be encrypted # "always": setup LDAP over SSL/TLS # "starttls": sets StartTLS as the encryption method tls: always # set to true to allow insecure tls insecure_tls_skip_verify: false # In case bind DN and password is required for querying user information, # specify them here. Plain text password is read from the file. bind_dn: "CN=xx_Docker_xx,OU=xxxxx_xxxxx,OU=xxxxxx,OU=xxxxxx,OU=xxxxx,OU=Root,DC=xxxxx,DC=local" bind_password_file: xxxxxxxx # User query settings. ${account} is expanded from auth request #base: o=example.com #filter: (&(uid=${account})(objectClass=person)) acl: # This will allow authenticated users to pull/push - match: account: /.+/ actions: ['*'] registry: restart: always image: registry:2 # hostname: "Registry_docker" environment: - REGISTRY_DELETE_ENABLED=true volumes: - /data/docker_registry:/var/lib/registry ports: - 5000:5000 

我正在docker上运行:

 cesanta]# docker version Client: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Wed Apr 27 00:34:42 2016 OS/Arch: linux/amd64 Server: Version: 1.11.1 API version: 1.23 Go version: go1.5.4 Git commit: 5604cbe Built: Wed Apr 27 00:34:42 2016 OS/Arch: linux/amd64 

这似乎是更好,更容易,但不知何故,它无法读取我的configuration文件…谢谢你所有的答案。

最后我使用了这个解决scheme:

https://github.com/tierratelematics/existing-ldap-docker-registry

有LDAP连接的一些TLS问题(我使用ldaps://)和openSSL应该升级在我身边(我有1.0.1版本),但最后它似乎是一个最简单的选项,运行良好,因为

https://github.com/cesanta/docker_auth

现在不适合我