2017-10-21 16:12:44 -05:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2019-01-21 02:39:27 -06:00
|
|
|
FROM ubuntu:18.04
|
2017-10-21 16:12:44 -05:00
|
|
|
|
2019-09-05 06:12:56 -05:00
|
|
|
# refresh repos otherwise installations later may fail
|
2017-10-21 16:12:44 -05:00
|
|
|
# install LibreOffice run-time dependencies
|
2018-12-08 09:08:03 -06:00
|
|
|
# install adduser, findutils, openssl and cpio that we need later
|
2018-11-16 04:18:29 -06:00
|
|
|
# install an editor
|
2020-10-02 03:53:04 -05:00
|
|
|
# tdf#117557 - Add CJK Fonts to Collabora Online Docker Image
|
2020-05-15 03:01:38 -05:00
|
|
|
RUN apt-get update && \
|
2020-05-28 06:23:56 -05:00
|
|
|
apt-get -y install libpng16-16 fontconfig adduser cpio \
|
2020-05-15 03:01:38 -05:00
|
|
|
findutils nano libpocoxml50 libpocoutil50 libpoconetssl50 \
|
|
|
|
libpoconet50 libpocojson50 libpocofoundation50 libpococrypto50 \
|
|
|
|
libcap2-bin openssl openssh-client inotify-tools procps \
|
|
|
|
libxcb-shm0 libxcb-render0 libxrender1 libxext6 \
|
|
|
|
fonts-wqy-zenhei fonts-wqy-microhei fonts-droid-fallback \
|
|
|
|
fonts-noto-cjk
|
2018-05-11 06:15:40 -05:00
|
|
|
|
2020-11-22 15:18:37 -06:00
|
|
|
# copy freshly built LOKit and Collabora Online
|
2017-10-21 16:12:44 -05:00
|
|
|
COPY /instdir /
|
|
|
|
|
2020-10-02 03:53:04 -05:00
|
|
|
# copy the shell script which can start Collabora Online (loolwsd)
|
2020-11-22 15:18:37 -06:00
|
|
|
COPY /start-collabora-online.sh /
|
2017-10-21 16:12:44 -05:00
|
|
|
|
2020-10-02 03:53:04 -05:00
|
|
|
# set up Collabora Online (normally done by postinstall script of package)
|
2020-02-11 04:05:21 -06:00
|
|
|
# Fix permissions
|
2020-05-15 03:01:38 -05:00
|
|
|
RUN setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit && \
|
wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc.. When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).
A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.
Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.
The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.
This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.
As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.
The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.
The random temp directory is now created and set
correctly, plus many logging and other improvements.
Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-04-09 08:02:58 -05:00
|
|
|
setcap cap_sys_admin=ep /usr/bin/loolmount && \
|
2020-05-15 03:01:38 -05:00
|
|
|
adduser --quiet --system --group --home /opt/lool lool && \
|
|
|
|
mkdir -p /var/cache/loolwsd && chown lool: /var/cache/loolwsd && \
|
|
|
|
rm -rf /var/cache/loolwsd/* && \
|
|
|
|
rm -rf /opt/lool && \
|
|
|
|
mkdir -p /opt/lool/child-roots && \
|
|
|
|
loolwsd-systemplate-setup /opt/lool/systemplate /opt/libreoffice >/dev/null 2>&1 && \
|
|
|
|
touch /var/log/loolwsd.log && \
|
|
|
|
chown lool:lool /var/log/loolwsd.log && \
|
|
|
|
chown -R lool:lool /opt/ && \
|
|
|
|
chown -R lool:lool /etc/loolwsd
|
2020-02-11 04:05:21 -06:00
|
|
|
|
2020-02-11 03:32:47 -06:00
|
|
|
EXPOSE 9980
|
2020-02-11 04:05:21 -06:00
|
|
|
|
|
|
|
# switch to lool user (use numeric user id to be compatible with Kubernetes Pod Security Policies)
|
|
|
|
USER 101
|
|
|
|
|
2020-11-22 15:18:37 -06:00
|
|
|
CMD bash /start-collabora-online.sh
|