1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-06 15:36:40 +00:00

enhance example for installing plugins at build time (#458)

* enhance example for installing plugins at build time

Relates to https://github.com/zokradonh/kopano-docker/issues/457

* do not always rebuild the webapp base when building the webapp plugins image
documentation
This commit is contained in:
Felix Bartels 2020-09-26 15:44:26 +02:00 committed by GitHub
parent 2c783d7256
commit d3ef8b472a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View File

@ -187,11 +187,13 @@ build-webapp: build-php
build-webapp-demo: build-webapp ## Replaces the actual kopano_webapp container with one that has login hints for demo.kopano.com.
docker build --rm \
--build-arg docker_repo=$(docker_repo) \
-f webapp/Dockerfile.demo \
-t $(docker_repo)/kopano_webapp webapp/
build-webapp-plugins: build-webapp ## Example for a custom image to install Kopano WebApp plugins
build-webapp-plugins: ## Example for a custom image to install Kopano WebApp plugins
docker build --rm \
--build-arg docker_repo=$(docker_repo) \
-f webapp/Dockerfile.plugins \
-t $(docker_repo)/kopano_webapp webapp/

View File

@ -1,3 +1,4 @@
# This Dockerfile can be built by running `make build-webapp-plugins` in the root of this project
ARG docker_repo=zokradonh
FROM ${docker_repo}/kopano_webapp
@ -6,6 +7,28 @@ ENV \
KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER=kopano_zpush:9080 \
KCCONF_WEBAPPPLUGIN_MDM_PLUGIN_MDM_SERVER_SSL=false
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
"${ADDITIONAL_KOPANO_PACKAGES}" \
"${ADDITIONAL_KOPANO_WEBAPP_PLUGINS}" \
kopano-webapp-plugin-files \
kopano-webapp-plugin-filesbackend-owncloud \
kopano-webapp-plugin-intranet \
kopano-webapp-plugin-mdm \
kopano-webapp-plugin-pimfolder \
kopano-webapp-plugin-smime \
&& rm -rf /var/cache/apt /var/lib/apt/lists
# tweak to make the container read-only
RUN mkdir -p /tmp/webapp/ && \
for i in /etc/kopano/webapp/* /etc/kopano/webapp/.[^.]*; do \
if [ -L "$i" ]; then \
continue; \
fi; \
if [[ "$i" = *.dist ]]; then \
continue; \
fi; \
mv -v "$i" "$i.dist"; \
ln -s /tmp/webapp/"$(basename "$i")" "$i"; \
done

View File

@ -31,6 +31,7 @@ if [ "${AUTOCONFIGURE}" == true ]; then
echo "Notice: Container is run read-only, skipping package installation."
echo "If you want to have additional packages installed in the container either:"
echo "- build your own image with the packages already included"
echo " - see https://github.com/zokradonh/kopano-docker/blob/master/webapp/Dockerfile.plugins for an example of such a Dockerfile"
echo "- switch the container to 'read_only: false'"
fi
@ -52,7 +53,8 @@ if [ "${AUTOCONFIGURE}" == true ]; then
# fallback for plugins installed during runtime
for i in /etc/kopano/webapp/*.php; do
filename=$(basename -- "$i")
if [ "$filename" = config.php ]; then
# skip file if its already a symlink
if [ -L "$i" ]; then
continue
fi
mv -vn "$i" "/tmp/webapp/$filename"