Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i add a template ? #30

Open
xgodon opened this issue May 16, 2017 · 7 comments
Open

how can i add a template ? #30

xgodon opened this issue May 16, 2017 · 7 comments
Labels

Comments

@xgodon
Copy link

xgodon commented May 16, 2017

I'd like to add a template in /var/www/phpldapadmin/templates/creation/ at the image start.
How can i do?
extending the image like :

FROM osixia/phpldapadmin:0.6.12
COPY custom_posixAccount.xml /var/www/phpldapadmin/templates/creation/custom_posixAccount.xml

give me the error :
"phpldapadmin_1 | cp: cannot create regular file ‘/var/www/phpldapadmin/config/config.php’: No such file or directory"

@dcendents
Copy link

I had the same problem. Lokking at the Dockerfile and the scripts, I figured you can copy them to the bootstrap directory to make it work.

e.g.:

FROM osixia/phpldapadmin:0.7.0
COPY custom_posixAccount.xml /var/www/phpldapadmin_bootstrap/templates/creation/custom_posixAccount.xml

@JensPfeifle
Copy link

Neither works for me:

FROM osixia/phpldapadmin:0.7.2
COPY custom_example.xml /var/www/phpldapadmin_bootstrap/templates/creation/custom_example.xml
COPY custom_example.xml /var/www/phpldapadmin/templates/creation/custom_example.xml

custom_example.xml is successfully copied to /var/www/phpldapadmin_bootstrap/templates/creation/ but is not found in /var/www/phpldapadmin/templates/creation/.
If I copy the xml manually (with docker exec) from phpldapadmin_bootstrap to phpldapadmin, I can see that the template loads correctly in the web interface.

I have also tried setting the file permissions to match the other template files with
RUN chown www-data:www-data /var/www/phpldapadmin_bootstrap/templates/creation/custom_example.xml

Anything I'm missing here?

@danekja
Copy link

danekja commented Nov 26, 2018

The dockerfile declares a VOLUME for /var/www/phpldapadmin. You need to remove it inbetween changes, otherwise they are not updated from the bootstrap folder.

@shynome
Copy link

shynome commented Dec 12, 2018

@BertrandGouny why not remove the Dockerfile config

VOLUME ["/var/www/phpldapadmin"]

it make difficulty to build my docke image, I have to rebuild the docker image, can't build from this image, I think the rebuild time is wasteful, can you improve this ?

At last, thanks for your spend time to complete this good project

@graue70
Copy link

graue70 commented Mar 8, 2019

I had the same problem and the solution given in #30 (comment) worked perfectly for me with version 0.7.2. Thank you!

@Vsevo1od
Copy link

Vsevo1od commented Sep 9, 2020

Here is how I did it:
Dockerfile

FROM osixia/phpldapadmin:0.9.0
COPY customUser.xml /
COPY startup.sh /container/service/phpldapadmin-additional-templates/
RUN chmod +x /container/service/phpldapadmin-additional-templates/startup.sh

startup.sh

#!/bin/bash -e
TEMPLATE_PATH=/customUser.xml

if [ -f $TEMPLATE_PATH ]; then
  mv $TEMPLATE_PATH  /var/www/phpldapadmin/templates/creation/
fi

exit 0

More info https://github.com/osixia/docker-light-baseimage#startupsh

@tomdaley92
Copy link

Thank you @Vsevo1od your solution worked perfectly for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants