FROM tiredofit/alpine:3.18 as builder LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" LABEL org.opencontainers.image.source="https://github.com/tiredofit/docker-collabora-online" ### Buildtime arguments ARG COLLABORA_ONLINE_VERSION ARG COLLABORA_ONLINE_REPO_URL ARG LIBREOFFICE_VERSION ARG LIBREOFFICE_REPO_URL ARG MAX_CONNECTIONS ARG MAX_DOCUMENTS ARG APP_NAME ARG APP_BRAND ### Environment Variables ENV COLLABORA_ONLINE_VERSION=${COLLABORA_ONLINE_VERSION:-"cp-23.05.0-2"} \ COLLABORA_ONLINE_REPO_URL=${COLLABORA_ONLINE_REPO_URL:-"https://github.com/CollaboraOnline/online"} \ # LIBREOFFICE_VERSION=${LIBREOFFICE_VERSION:-"cp-23.05.0-2"} \ LIBREOFFICE_REPO_URL=${LIBREOFFICE_REPO_URL:-"https://github.com/LibreOffice/core"} \ # APP_NAME=${APP_NAME:-"Document Editor"} \ APP_BRAND=${APP_BRAND:-"unbranded"} \ # POCO_VERSION=${POCO_VERSION:-"poco-1.12.4-release.tar.gz"} \ POCO_URL=${POCO_URL:-"https://github.com/pocoproject/poco/archive/"} \ # MAX_CONNECTIONS=${MAX_CONNECTIONS:-"100000"} \ ## Uses Approximately 20mb per document open MAX_DOCUMENTS=${MAX_DOCUMENTS:-"100000"} COPY build-assets /build-assets RUN source /assets/functions/00-container && \ set -x && \ package update && \ package upgrade && \ package install .container-build-deps \ build-base \ git \ && \ package install .collabora-office-build-deps \ abseil-cpp-dev \ apache-ant \ autoconf \ automake \ bison \ bluez-dev \ boost-dev \ box2d-dev \ clang \ clucene-dev \ coreutils \ cppunit-dev \ cups-dev \ doxygen \ findutils \ flex \ freetype-dev \ glew-dev \ glm-dev \ glu-dev \ gperf \ gpgme-dev \ gst-plugins-base-dev \ gstreamer-dev \ gtk+3.0-dev \ gtk4.0-dev \ harfbuzz-dev \ hunspell-dev \ hyphen-dev \ icu-dev \ junit \ kconfig-dev \ lcms2-dev \ libabw-dev \ libcdr-dev \ libe-book-dev \ libepubgen-dev \ libetonyek-dev \ libexttextcat-dev \ libfreehand-dev \ libjpeg-turbo-dev \ libmspub-dev \ libmwaw-dev \ libnumbertext-dev \ libodfgen-dev \ liborcus-dev \ libpagemaker-dev \ libpq-dev \ libqxp-dev \ libstaroffice-dev \ libvisio-dev \ libwebp-dev \ libwpd-dev \ libwpg-dev \ libwps-dev \ libxml2-utils \ libxrandr-dev \ libxrender-dev \ libxslt-dev \ libzmf-dev \ llvm-dev \ mariadb-dev \ mdds-dev \ mythes-dev \ neon-dev \ nss-dev \ openjpeg-dev \ openldap-dev \ openssl-dev \ perl \ perl-archive-zip \ plasma-framework-dev \ poppler-dev \ py3-setuptools \ python3-dev \ qt5-qtbase-dev \ qt5-qttools-dev \ qt6-qtbase-dev \ qt6-qttools-dev \ redland-dev \ sed \ tar \ unixodbc-dev \ vigra-dev \ xmlsec-dev \ xz \ zip \ && \ \ ### Build Poco mkdir -p /usr/src/poco && \ curl -sSL ${POCO_URL}${POCO_VERSION} | tar xvfz - --strip 1 -C /usr/src/poco && \ cd /usr/src/poco && \ ./configure \ --static \ --no-tests \ --no-samples \ --no-sharedlibs \ --cflags="-fPIC" \ --omit=Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,Redis,Encodings \ --prefix=/opt/poco \ && \ make -j$(nproc) && \ make install && \ \ ### Build Fetch LibreOffice - This will take a while.. clone_git_repo ${LIBREOFFICE_REPO_URL} ${LIBREOFFICE_VERSION} ${GIT_REPO_SRC_CORE} RUN source /assets/functions/00-container && \ set -x && \ GIT_REPO_SRC_CORE=/usr/src/core && \ adduser -D -S -h /dev/null -s /sbin/nologin -u 1000 cool && \ cd /usr/src/core && \ if [ -d "/build-assets/core/src" ] && [ -n "$(ls -A "/build-assets/core/src" 2>/dev/null)" ]; then cp -R /build-assets/core/src/* / ; fi; \ if [ -d "/build-assets/core/scripts" ] && [ -n "$(ls -A "/build-assets/core/scripts" 2>/dev/null)" ]; then for script in /build-assets/core/scripts/*.sh; do echo "** Applying $script"; bash $script; done && \ ; fi ; \ sed -i "s|--enable-symbols|--disable-symbols|g" ${GIT_REPO_SRC_CORE}/distro-configs/CPLinux-LOKit.conf && \ \ echo "--prefix=/opt/libreoffice" >> ${GIT_REPO_SRC_CORE}/distro-configs/CPLinux-LOKit.conf && \ ./autogen.sh \ --with-distro="CPLinux-LOKit" \ --disable-epm \ --without-package-format && \ chown -R cool ${GIT_REPO_SRC_CORE} && \ sudo -u cool make fetch RUN source /assets/functions/00-container && \ set -x && \ sudo -u cool make -j$(nproc) build && \ mkdir -p /opt/libreoffice && \ chown -R cool /opt/libreoffice && \ cp -R ${GIT_REPO_SRC_CORE}/instdir/* /opt/libreoffice/