docker-openldap icon indicating copy to clipboard operation
docker-openldap copied to clipboard

Container port cannot be modified

Open golangav opened this issue 3 years ago • 4 comments

Container port cannot be modified

I want motify 389 --> 8000, but not success。 What should I do?

--hostname ldap1.xx.com
-e LDAP_BASE_DN="dc=xx,dc=com"
-e LDAP_DOMAIN="xx.com"
-e LDAP_ORGANISATION="xx.com"
-e LDAP_ADMIN_PASSWORD='xxxxx'
-e LDAP_REPLICATION=true
-e LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap1.xx.com','ldap://ldap2.xx.com']"
-e ANOTHER_NODE_HOSTNAME='ldap2.xx.com'
-e ANOTHER_NODE_IP='192.168.1.2'
-e LDAP_TLS_VERIFY_CLIENT="never"
-e TZ=Asia/Shanghai
-p 8000:8000 \

golangav avatar Oct 09 '21 06:10 golangav

Try -p 8000:389

Anton-Kartashev avatar Oct 13 '21 11:10 Anton-Kartashev

Allowing to change the internal port, would open up a new use case where you can use this image with podman in a rootless setup. Which is exactly my constraint, sadly.

schapsl avatar Oct 25 '23 07:10 schapsl

Based on script that actually runs slapd inside the container: image/service/slapd/process.sh

HOST_PARAM="ldap://$FQDN:$LDAP_PORT ldaps://$FQDN:$LDAPS_PORT"
exec /usr/sbin/slapd -h "$HOST_PARAM ldapi:///" -u openldap -g openldap -d "$LDAP_LOG_LEVEL"

Just provide in a runtime the following ENV variables: LDAP_PORT LDAPS_PORT

nix-power avatar Oct 25 '23 08:10 nix-power

Occasionally these default values set in the following file:

image/environment/default.yaml

and could be overriden, of course, in a runtime

#This is the default image configuration file
#These values will persists in container environment.
#All environment variables used after the container first start
#must be defined here.
#more information : https://github.com/osixia/docker-light-baseimage

#General container configuration
#see table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.

LDAP_LOG_LEVEL: 256

#Ulimit
LDAP_NOFILE: 1024

#Do not perform any chown to fix file ownership
DISABLE_CHOWN: false

#Default port to bind slapd
LDAP_PORT: 389
LDAPS_PORT: 636

nix-power avatar Oct 25 '23 08:10 nix-power