I am using YAML file configuration as below mentioned, unable to create a folder and change access of dir.
It is able to create the directory but unable to complete this command chmod 777 /opt/ldap
ldap:
image: osixia/openldap:1.3.0
env_file:
- env/ldap.env
networks:
appworks_net:
aliases:
- docker_container.local
restart: "no"
command: bash -c "mkdir -p /opt/ldap && chmod 777 /opt/ldap" - **creates only folder**
command: ["/bin/bash", "-c", "mkdir -p /opt/ldap && chmod 777 /opt/ldap"] -- fails start container
command: ["-c", "chmod 777 /opt/ldap"] -- does not work
command: chmod 777 /opt/ldap -- does not work
command: ["-c", "mkdir -p /opt/appworks/ldap", "chmod 777 /opt/appworks/ldap"] -- only creates folder
command:
- -c
- |
mkdir -p /opt/ldap
chmod 777 /opt/ldap -- **creates only folder**
healthcheck:
test: ["CMD-SHELL", '/usr/bin/ldapsearch -h ldaps://$$HOSTNAME -p $$PORT -w $$LDAP_ADMIN_PASSWORD -D "cn=admin,dc=trialorg,dc=local" -b "dc=trialorg,dc=local" | grep "dn:"']
interval: 5s
timeout: 5s
retries: 10
please help me here if there are any possible working ideas. I don't want to create a new image using a docker / entrypoint. I just that two commands to run post container is started.