Docker Libreoffice Online

broken image


With LibreOffice Online you can edit office documents in your browser. You need a workingLibreOffice Online server. More info on https://www.libreoffice.org/download/libreoffice-online/

The preferred choice for millions of developers that are building containerized apps. Docker Desktop is an application for MacOS and Windows machines for the building and sharing of containerized applications. Access Docker Desktop and follow the guided onboarding to build your first containerized application in minutes. Asked: 2017-04-02 21:14:55 +0200 Seen: 4,954 times Last updated: Sep 28 '20. Collabora Online Development Edition (CODE) is available as a Docker image from Docker Hub. Currently the only supported platform is x86-64, and the image was mostly tested on Linux. If you are not familiar with Docker concepts and basic commands, read the Docker Get Started document first. Grab the Docker image like this: $ docker. CODE is built on top of a huge volume of work from both LibreOffice, however the Online functionality was created primarily by Collabora (as announced in 2015) – read more about the story of that here. And thanks to Lukas Reschke for help with the docker image.

Libreoffice Online Wopi

For LibreOffice Online to work you need to setup SSL and allow your Group-Office URL to use it.In case you need some guidance on how to set it up we wrote a blog post on how to setupLibreOffice Online here:

Install the Office Online module from the Business package at System Settings -> Modules.

Reload Group-Office and go to System Settings -> Office Online.

Then add your LibreOffice Online Service. The default port for LibreOffice online is 9980. BUt with the reverse proxy setupabove we're using the standard SSL port so it's not necessary to specify it.

Now every user can go to the files module and use it. Just right click a file and choose 'Open with…'.

Note

If you get a 404 error when editing because /wopi is not found then you probably are missing the alias in yourwebserver configuration. The Group-Office Debian and Docker packages automatically create this but with the tarballpackage you have to do this manually.Example configuration can be found here.

< Development
  • → Open Issues

Introductory notice

Compilation of LibreOffice online (LOOL from this point) can be quite tricky. Using docker is highly suggested and is what this wiki page covers. For a native installation you can also have a look at this document by the infrastructure team.

Docker Libreoffice Online

System requirements

The compilation will require almost 30GB. Suggested setup: at least a 2 cores-CPU with 4GB of RAM.

Environment setup

Since LibreOffice core build fails when trying to make as root, LOOL build is even encouraged to be runas regular user. This user needs access to sudo without password to set the capabilities of the newly-build executables.Therefore, using isolate machines to run the builds is suggested.

The first step is to create the user (make sure even to create the home for the usersince it's required by npm): useradd -s /bin/bash -m lool

The user also needs to be a member of the Docker group to build the image: adduser lool docker

Once the user is created, you will need to authorize him to use sudo. Edit thesudoers file (with your preferred editor or running visudo) and addsomething like

save & exit.

Note:
This guide has been written and tested on Debian 10. Packages names and versions may vary on other distros. Ubuntu 18.04 instructions follows.

Prerequisites for building on Debian 10

Prerequisites for building on Ubuntu 18.04

  1. (this is not checked in configure, but fails later in make)
  2. cannot apt-get install npm since libpoco-dev and npm packages conflict (https://stackoverflow.com/questions/56463987/installing-libpoco-and-npm-conflict) so from https://github.com/nvm-sh/nvm:
    1. reopen terminal
    2. reopen terminal

Clone of the repository

Docker Libreoffice Online

Now choose a working directory. The following will use /opt. Use of /tmp is discouraged.

Compilation of a LOOL docker image

A docker image is the easiest way to have a working version of LOOL built.A script (l10n-docker-nightly.sh) isprovided by LOOL developers to (almost) automatically build the required core part, LOOL and close the binariesinside a docker container.

If you have followed the Environment setup you're ready to run the build.

The script will run through the compilation of the core and the online and then build the docker imageas libreoffice/online:master but (normally) will fail to push (since you don't haveaccess to the libreoffice namespace in the dockerhub) but you can disable the push byusing the NO_DOCKER_PUSH flag.

Online

Choosing the branch to compile

If you're interested in compiling a stable image, make sure to pickthe same version of the software from online and core.

For example, if you want to compile the latest stable version you have to

  • go to https://git.libreoffice.org/online/+refs and look for the branches whose names starts with 'libreoffice-', which are the non-branded mainline.

At the moment of writing this page, the latest available is libreoffice-6-4.

  • go to https://git.libreoffice.org/core/+refs and look for the branches whose names starts with the online version you found.

At the moment of writing this page, the latest core available that matches with the online is the libreoffice-6-4-4.

Docker Libreoffice Online

Now that you found out which branches you want to compile, you simply have to start the build with something like

Of course, if stability doesn't matter for you, you can simply build the two master branches. And here's another sample for the 7.0 branch:

Libreoffice Draw Online

The optional parameters DOCKER_HUB_REPO and DOCKER_HUB_TAG help to identify the container. While the first sample (6-4-4), lacking the parameters, is referred to as libreoffice/online:master, the second sample is referred to as libreoffice/online:7-0-0.

Automating stable compilation

The following script may be used to automatically fetch the latest (supposed) stable version and compile it. You can run it in something like a nightly build. In any case, using ccache is highly suggested to enhance a lot the build times after the first.

Warning: since online branch is now from Collabora Online, you need to checkout last LibreOffice upstream version

l10n-docker-nightly.sh supported flags

The l10n-docker-nightly.sh script supports a few variables to personalize the build. An up-to-datelist of the supported flags are written in the first comments of the script.

Docker libreoffice online tutorial

System requirements

The compilation will require almost 30GB. Suggested setup: at least a 2 cores-CPU with 4GB of RAM.

Environment setup

Since LibreOffice core build fails when trying to make as root, LOOL build is even encouraged to be runas regular user. This user needs access to sudo without password to set the capabilities of the newly-build executables.Therefore, using isolate machines to run the builds is suggested.

The first step is to create the user (make sure even to create the home for the usersince it's required by npm): useradd -s /bin/bash -m lool

The user also needs to be a member of the Docker group to build the image: adduser lool docker

Once the user is created, you will need to authorize him to use sudo. Edit thesudoers file (with your preferred editor or running visudo) and addsomething like

save & exit.

Note:
This guide has been written and tested on Debian 10. Packages names and versions may vary on other distros. Ubuntu 18.04 instructions follows.

Prerequisites for building on Debian 10

Prerequisites for building on Ubuntu 18.04

  1. (this is not checked in configure, but fails later in make)
  2. cannot apt-get install npm since libpoco-dev and npm packages conflict (https://stackoverflow.com/questions/56463987/installing-libpoco-and-npm-conflict) so from https://github.com/nvm-sh/nvm:
    1. reopen terminal
    2. reopen terminal

Clone of the repository

Now choose a working directory. The following will use /opt. Use of /tmp is discouraged.

Compilation of a LOOL docker image

A docker image is the easiest way to have a working version of LOOL built.A script (l10n-docker-nightly.sh) isprovided by LOOL developers to (almost) automatically build the required core part, LOOL and close the binariesinside a docker container.

If you have followed the Environment setup you're ready to run the build.

The script will run through the compilation of the core and the online and then build the docker imageas libreoffice/online:master but (normally) will fail to push (since you don't haveaccess to the libreoffice namespace in the dockerhub) but you can disable the push byusing the NO_DOCKER_PUSH flag.

Choosing the branch to compile

If you're interested in compiling a stable image, make sure to pickthe same version of the software from online and core.

For example, if you want to compile the latest stable version you have to

  • go to https://git.libreoffice.org/online/+refs and look for the branches whose names starts with 'libreoffice-', which are the non-branded mainline.

At the moment of writing this page, the latest available is libreoffice-6-4.

  • go to https://git.libreoffice.org/core/+refs and look for the branches whose names starts with the online version you found.

At the moment of writing this page, the latest core available that matches with the online is the libreoffice-6-4-4.

Now that you found out which branches you want to compile, you simply have to start the build with something like

Of course, if stability doesn't matter for you, you can simply build the two master branches. And here's another sample for the 7.0 branch:

Libreoffice Draw Online

The optional parameters DOCKER_HUB_REPO and DOCKER_HUB_TAG help to identify the container. While the first sample (6-4-4), lacking the parameters, is referred to as libreoffice/online:master, the second sample is referred to as libreoffice/online:7-0-0.

Automating stable compilation

The following script may be used to automatically fetch the latest (supposed) stable version and compile it. You can run it in something like a nightly build. In any case, using ccache is highly suggested to enhance a lot the build times after the first.

Warning: since online branch is now from Collabora Online, you need to checkout last LibreOffice upstream version

l10n-docker-nightly.sh supported flags

The l10n-docker-nightly.sh script supports a few variables to personalize the build. An up-to-datelist of the supported flags are written in the first comments of the script.

Docker Libreoffice Online

FlagFunctionBehaviour
DOCKER_HUB_REPOwhich Docker Hub repo to useChanges the docker image name. If undefined, libreoffice/online will be used.
DOCKER_HUB_TAGwhich Docker Hub tag to createChanges the docker image tag. If undefined, master will be used.
LIBREOFFICE_BRANCHwhich branch to build in coreChanges the branch to build from the core repository. If undefined, master will be used.
LIBREOFFICE_ONLINE_BRANCHwhich branch to build in onlineChanges the branch to build from the online repository. If undefined, master will be used.
LIBREOFFICE_BUILD_TARGETwhich make target to run (in core repo)Changes the build target of core. If undefined, nothing will be passed to make.
ONLINE_EXTRA_BUILD_OPTIONSextra build options for onlineAdds options to the ./configure script of the online repository.
NO_DOCKER_IMAGEif set, don't build the docker image itself, just do all the prepsif undefined, the option will be performed
NO_DOCKER_PUSHdon't push to docker hubif undefined, the option will be performed

Running separate unit tests

To run a single unit test, use this command:

To debug it, modify to this:

Collabora Online Docker

Retrieved from 'https://wiki.documentfoundation.org/index.php?title=Development/BuildingOnline&oldid=323215'




broken image