Update dockerfile
This commit is contained in:
parent
2a4d5156c9
commit
a83c87f270
13
dockerfile
13
dockerfile
@ -17,15 +17,25 @@ RUN echo "slapd slapd/password1 password admin" | debconf-set-selections && \
|
||||
# make use of debconf-set-selections
|
||||
RUN dpkg-reconfigure -f noninteractive slapd
|
||||
|
||||
# create a script to automatically start slapd while this dockerfile is being parsed
|
||||
COPY start-slapd.sh ./start-slapd.sh
|
||||
RUN chmod +x ./start-slapd.sh
|
||||
|
||||
# open up LDAP simple port
|
||||
EXPOSE 389
|
||||
|
||||
# set salvable volumes for LDAP data, configuration
|
||||
VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
|
||||
#VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
|
||||
|
||||
# set correct permissions for openldap user
|
||||
RUN chown -R openldap:openldap /var/lib/ldap /etc/ldap/slapd.d
|
||||
|
||||
# ENTRYPOINT ensures this sh file ALWAYS runs first before any CMD or command line instruction
|
||||
ENTRYPOINT ["./start-slapd.sh"]
|
||||
|
||||
# CMD provides the default command (/bin/bash) which is passed as an argument to the ENTRYPOINT script
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
### optional use ###
|
||||
# start slapd
|
||||
#CMD ["slapd", "-h", "ldap:/// ldapi:///", "-g", "openldap", "-u", "openldap", "-F", "/etc/ldap/slapd.d"]
|
||||
@ -34,4 +44,5 @@ RUN chown -R openldap:openldap /var/lib/ldap /etc/ldap/slapd.d
|
||||
#ENTRYPOINT ["/entrypoint.sh"]
|
||||
#CMD ["bash"]
|
||||
|
||||
# //run img container with 'docker run -i -t -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d ldapdock' for interactive shell
|
||||
# run img container with 'docker run -i -t -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d ldapdock' for interactive shell
|
||||
Loading…
Reference in New Issue
Block a user