|
| 1 | +# SPDX-FileCopyrightText: © 2025 Nfrastack <code@nfrastack.com> |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +ARG \ |
| 6 | + BASE_IMAGE |
| 7 | + |
| 8 | +FROM ${BASE_IMAGE} |
| 9 | + |
| 10 | +LABEL \ |
| 11 | + org.opencontainers.image.title="OpenLDAP w/FusionDirectory" \ |
| 12 | + org.opencontainers.image.description="Directory server with FusionDirectory schemas" \ |
| 13 | + org.opencontainers.image.url="https://hub.docker.com/r/nfrastack/openldap-fusiondirectory" \ |
| 14 | + org.opencontainers.image.documentation="https://github.com/nfrastack/container-openldap-fusiondirectory/blob/main/README.md" \ |
| 15 | + org.opencontainers.image.source="https://github.com/nfrastack/container-openldap-fusiondirectory.git" \ |
| 16 | + org.opencontainers.image.authors="Nfrastack <code@nfrastack.com>" \ |
| 17 | + org.opencontainers.image.vendor="Nfrastack <https://www.nfrastack.com>" \ |
| 18 | + org.opencontainers.image.licenses="MIT" |
| 19 | + |
| 20 | +COPY CHANGELOG.md /usr/src/container/CHANGELOG.md |
| 21 | +COPY LICENSE /usr/src/container/LICENSE |
| 22 | +COPY README.md /usr/src/container/README.md |
| 23 | + |
| 24 | +ARG \ |
| 25 | + FUSIONDIRECTORY_VERSION="fusiondirectory-1.5" \ |
| 26 | + FUSIONDIRECTORY_REPO_URL="https://github.com/fusiondirectory/fusiondirectory" \ |
| 27 | + FUSIONDIRECTORY_INTEGRATOR_REPO_URL="https://github.com/fusiondirectory/fusiondirectory-integrator" \ |
| 28 | + FUSIONDIRECTORY_INTEGRATOR_VERSION="1.2" \ |
| 29 | + FUSIONDIRECTORY_PLUGINS_VERSION="fusiondirectory-1.5" \ |
| 30 | + FUSIONDIRECTORY_PLUGINS_REPO_URL="https://github.com/fusiondirectory/fusiondirectory-plugins" \ |
| 31 | + FUSIONDIRECTORY_TOOLS_VERSION="1.2" \ |
| 32 | + FUSIONDIRECTORY_TOOLS_REPO_URL="https://github.com/fusiondirectory/fusiondirectory-tools" \ |
| 33 | + PHP_VERSION="php-7.4.33" \ |
| 34 | + PHP_REPO_URL="https://github.com/php/php-src" |
| 35 | + |
| 36 | +ENV \ |
| 37 | + IMAGE_NAME="nfrastack/openldap-fusiondirectory" \ |
| 38 | + IMAGE_REPO_URL="https://github.com/nfrastack/container-openldap-fusiondirectory/" |
| 39 | + |
| 40 | +RUN echo "" && \ |
| 41 | + OPENLDAP_FUSIONDIRECTORY_BUILD_DEPS_ALPINE=" \ |
| 42 | + git \ |
| 43 | + " && \ |
| 44 | + OPENLDAP_FUSIONDIRECTORY_RUN_DEPS_ALPINE=" \ |
| 45 | + " && \ |
| 46 | + PHP_BUILD_DEPS_ALPINE=" \ |
| 47 | + autoconf \ |
| 48 | + automake \ |
| 49 | + bison \ |
| 50 | + build-base \ |
| 51 | + cyrus-sasl-dev \ |
| 52 | + libevent-dev \ |
| 53 | + libtool \ |
| 54 | + linux-headers \ |
| 55 | + musl-dev \ |
| 56 | + openssl-dev \ |
| 57 | + re2c \ |
| 58 | + " && \ |
| 59 | + PHP_RUN_DEPS_ALPINE=" \ |
| 60 | + cyrus-sasl \ |
| 61 | + libevent \ |
| 62 | + #libxml2 \ |
| 63 | + openssl \ |
| 64 | + " && \ |
| 65 | + source /container/base/functions/container/build && \ |
| 66 | + container_build_log image && \ |
| 67 | + package update && \ |
| 68 | + package upgrade && \ |
| 69 | + package install \ |
| 70 | + PHP_BUILD_DEPS \ |
| 71 | + PHP_RUN_DEPS \ |
| 72 | + && \ |
| 73 | + clone_git_repo "${PHP_REPO_URL}" "${PHP_VERSION}" /usr/src/php && \ |
| 74 | + curl -ssL https://gitlab.alpinelinux.org/alpine/aports/-/raw/3.19-stable/community/php81/fix-lfs64.patch?ref_type=heads -o /usr/src/php/fix-lfs64.patch && \ |
| 75 | + patch -d /usr/src/php -p1 < /usr/src/php/fix-lfs64.patch && \ |
| 76 | + ./buildconf --force && \ |
| 77 | + ./configure \ |
| 78 | + --prefix=/usr/local/php \ |
| 79 | + --disable-all \ |
| 80 | + --disable-cgi \ |
| 81 | + --enable-cli \ |
| 82 | + --disable-fpm \ |
| 83 | + --disable-phpdbg \ |
| 84 | + --enable-posix \ |
| 85 | + --with-ldap \ |
| 86 | + --with-ldap-sasl=/usr/include/sasl \ |
| 87 | + && \ |
| 88 | + make -j "$(nproc)" && \ |
| 89 | + make install && \ |
| 90 | + ln -s /usr/local/php/bin/php /usr/bin/php && \ |
| 91 | + container_build_log add "PHP" "${PHP_VERSION}" "${PHP_REPO_URL}" && \ |
| 92 | + \ |
| 93 | + package install \ |
| 94 | + OPENLDAP_FUSIONDIRECTORY_BUILD_DEPS \ |
| 95 | + OPENLDAP_FUSIONDIRECTORY_RUN_DEPS \ |
| 96 | + && \ |
| 97 | + clone_git_repo "${FUSIONDIRECTORY_INTEGRATOR_REPO_URL}" "${FUSIONDIRECTORY_INTEGRATOR_VERSION}" && \ |
| 98 | + mkdir -p /usr/share/php/FusionDirectory/ && \ |
| 99 | + cp -R "${GIT_REPO_SRC_FUSIONDIRECTORY_INTEGRATOR%/}"/src/* /usr/share/php/FusionDirectory && \ |
| 100 | + container_build_log add "FusionDirectory Integrator" "${FUSIONDIRECTORY_INTEGRATOR_VERSION}" "${FUSIONDIRECTORY_INTEGRATOR_REPO_URL}"&& \ |
| 101 | + clone_git_repo "${FUSIONDIRECTORY_TOOLS_REPO_URL}" "${FUSIONDIRECTORY_TOOLS_VERSION}" && \ |
| 102 | + cp -aR "${GIT_REPO_SRC_FUSIONDIRECTORY_TOOLS%/}"/bin/* /usr/local/bin && \ |
| 103 | + cp -aR "${GIT_REPO_SRC_FUSIONDIRECTORY_TOOLS%/}"/src/FusionDirectory/Tools /usr/share/php/FusionDirectory/FusionDirectory/ && \ |
| 104 | + container_build_log add "FusionDirectory Tools" "${FUSIONDIRECTORY_TOOLS_VERSION}" "${FUSIONDIRECTORY_TOOLS_REPO_URL}" && \ |
| 105 | + clone_git_repo "${FUSIONDIRECTORY_REPO_URL}" "${FUSIONDIRECTORY_VERSION}" /usr/src/fusiondirectory && \ |
| 106 | + container_build_log add "FusionDirectory Schemas" "${FUSIONDIRECTORY_VERSION}" "${FUSIONDIRECTORY_REPO_URL}" && \ |
| 107 | + clone_git_repo "${FUSIONDIRECTORY_PLUGINS_REPO_URL}" "${FUSIONDIRECTORY_PLUGINS_VERSION}" /usr/src/fusiondirectory-plugins && \ |
| 108 | + container_build_log add "FusionDirectory Plugins Schemas" "${FUSIONDIRECTORY_PLUGINS_VERSION}" "${FUSIONDIRECTORY_PLUGINS_REPO_URL}" && \ |
| 109 | + clone_git_repo https://github.com/tiredofit/fusiondirectory-plugin-kopano main /usr/src/fusiondirectory-plugin-kopano && \ |
| 110 | + cp -R /usr/src/fusiondirectory-plugin-kopano/kopano "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}" && \ |
| 111 | + container_build_log add "FusionDirectory Kopano Plugin Schema" "main" "https://github.com/tiredofit/fusiondirectory-plugin-kopano" && \ |
| 112 | + clone_git_repo https://github.com/slangdaddy/fusiondirectory-plugin-nextcloud master /usr/src/fusiondirectory-plugin-nextcloud && \ |
| 113 | + rm -rf /usr/src/fusiondirectory-plugin-nextcloud/src/DEBIAN && \ |
| 114 | + mkdir -p "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}"/nextcloud && \ |
| 115 | + cp -R /usr/src/fusiondirectory-plugin-nextcloud/src/* "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}"/nextcloud/ && \ |
| 116 | + container_build_log add "FusionDirectory Nextcloud Plugin Schema" "master" "https://github.com/slangdaddy/fusiondirectory-plugin-nextcloud" && \ |
| 117 | + clone_git_repo https://github.com/gallak/fusiondirectory-plugins-seafile master /usr/src/fusiondirectory-plugins-seafile && \ |
| 118 | + mkdir -p "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}"/seafile && \ |
| 119 | + cp -R /usr/src/fusiondirectory-plugins-seafile/* "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}"/seafile/ && \ |
| 120 | + container_build_log add "FusionDirectory Seafile Plugin Schema" "main" "https://github.com/gallak/fusiondirectory-plugins-seafile" && \ |
| 121 | + mkdir -p /etc/openldap/schema/fusiondirectory && \ |
| 122 | + rm -rf /usr/src/fusiondirectory/contrib/openldap/rfc2307bis.schema && \ |
| 123 | + #cp "${GIT_REPO_SRC_FUSIONDIRECTORY%/}"/contrib/bin/fusiondirectory-insert-schema /usr/local/bin && \ |
| 124 | + cp -R \ |
| 125 | + "${GIT_REPO_SRC_FUSIONDIRECTORY%/}"/contrib/openldap/*.schema \ |
| 126 | + "${GIT_REPO_SRC_FUSIONDIRECTORY_PLUGINS%/}"/*/contrib/openldap/*.schema \ |
| 127 | + /etc/openldap/schema/fusiondirectory && \ |
| 128 | + \ |
| 129 | + #sed -i -e "s|/etc/ldap/schema|/etc/openldap/schema|g" /usr/local/bin/fusiondirectory-insert-schema && \ |
| 130 | + #chmod +x /usr/local/bin/fusiondirectory-insert-schema && \ |
| 131 | + package remove \ |
| 132 | + OPENLDAP_FUSIONDIRECTORY_BUILD_DEPS \ |
| 133 | + PHP_BUILD_DEPS \ |
| 134 | + && \ |
| 135 | + package cleanup |
| 136 | + |
| 137 | +COPY rootfs / |
0 commit comments