Update README.md

This commit is contained in:
Marisa 2025-11-20 06:02:02 -05:00
parent 01c80ddfc0
commit 5fa9c651e0

View File

@ -9,7 +9,7 @@ _note about the dockerfile and running the generated image container on FG (fore
build ldapdock build ldapdock
``` ```
> docker build -t ldapdock /path/to/dockerfile > sudo docker build --build-arg LDAP_HOST=example.com -t ldapdock .
``` ```
after build, check the docker image has been created properly with the given REPOSITORY name after build, check the docker image has been created properly with the given REPOSITORY name
@ -21,11 +21,11 @@ ldapdock latest 0e4a1521b346 6 hours ago 138MB
If you just want to jump in the container and right now don't care saving the configuration or directories, you can run it with this command: If you just want to jump in the container and right now don't care saving the configuration or directories, you can run it with this command:
``` ```
> docker run -h example.com -i -p 389:389 -p 639:639 -t ldapdock > docker run -h ${LDAP_HOST:-example.com} -i -p 389:389 -p 639:639 -t ldapdock
``` ```
If you wish (and it is recommended in development) to save the configuration and LDAP directory structure (also called LDAP database) outside of the container, run this command instead: If you wish (and it is recommended in development) to save the configuration and LDAP directory structure (also called LDAP database) outside of the container, run this command instead:
``` ```
> docker run -h example.com -i -p 389:389 -p 639:639 -t -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d ldapdock > sudo docker run -i -t -p 389:389 -p 636:636 -h ${LDAP_HOST:-example.com} -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d -v ldap_certs:/etc/ldap/certs -v $(pwd)/hosts-certs:/export-certs ldapdock
``` ```
`Parameters explanation:`with -h we are specifying the name of the host, we are using example.com, this is very important. -i tells docker to run in an interactive way instead of running the container in the background. -t goes in hand with -i, and allocates a tty (terminal) so we can run commands. The parameter -p tells Docker it's the port our server will use. -v mounts a volume to save miscellaneous data in general, and config, content such as directories, databases and users. `Parameters explanation:`with -h we are specifying the name of the host, we are using example.com, this is very important. -i tells docker to run in an interactive way instead of running the container in the background. -t goes in hand with -i, and allocates a tty (terminal) so we can run commands. The parameter -p tells Docker it's the port our server will use. -v mounts a volume to save miscellaneous data in general, and config, content such as directories, databases and users.