Docker Install Libreoffice

admin 11/22/2021
24 Comments

The key would be to determine just the extra packages needed for libreoffice and add those to the Docker file and keep the -no-install-recommends. Ffdixon changed the title pptx conversion broken for Asian languages on 2.3a Determine minimal additions to bbb-libreoffice docker container to support Asian letters Dec 29, 2020. Docker libreoffice as a DOCX to PDF conversion service - Dockerfile. Clone via HTTPS Clone with Git or checkout with SVN using the repository’s web address. LibreOffice Online based on https://hub.docker.com/r/libreoffice/online/.

Use this information to quickly start up Content Services using Docker Compose. Due to the limited capabilities of Docker Compose, this deployment method is recommended for development and test environments only.

To deploy Content Services using Docker Compose, download and install Docker, then follow the steps below. Make sure that you’ve reviewed the prerequisites before continuing.

  1. Clone the repository locally or download one of the docker-compose.yml files (e.g. 6.0.N-docker-compose.yml), and then change directory to the project folder:

    Note: Make sure that the following ports are free on your computer: 5432, 8080, 8082, 8083. These ports are set in the docker-compose.yml file - refer to the host:container port definitions.

    See the Alfresco/acs-deployment project README for more information.

  2. Change directory to the location of your docker-compose.yml file.

  3. Deploy Content Services, including the repository, Share, Postgres database, Search Services, etc.:

    This downloads the images, fetches all the dependencies, creates each container, and then starts the system:

    As an alternative, you can also start the containers in the background by running docker-compose up -d.

  4. Wait for the logs to complete, showing messages:

    See Troubleshooting if you encounter errors whilst the system is starting up.

  5. Open your browser and check everything starts up correctly:

    ServiceEndpoint
    Administration and REST APIshttp://localhost:8080/alfresco
    Sharehttp://localhost:8080/share
    Search Services administrationhttp://localhost:8083/solr

    If Docker is running on your local machine, the IP address will be just localhost.

    If you’re using the Docker Toolbox, run the following command to find the IP address:

  6. Log in as the admin user. Enter the default administrator password admin.

Check system start up

Use this information to verify that the system started correctly, and to clean up the deployment.

  1. Open a new terminal window.

  2. Change directory to the docker-compose folder that you created in the deployment steps.

  3. Verify that all the services started correctly.

    1. List the images and additional details:

      You should see a list of the services defined in your docker-compose.yaml file:

    2. List the running containers:

      You should see a list of the services defined in the docker-compose.yaml file.

    3. View the log files for each service <service-name>, or container <container-name>:

      For example, to check the logs for Share, run any of the following commands:

      You can add an optional parameter --tail=25 before <container-name> to display the last 25 lines of the logs for the selected container.

      Check for a success message:

    Once you’ve tested the services, you can clean up the deployment by stopping the running services.

  4. Stop the session by using CONTROL+C in the same window as the running services:

  5. Alternatively, you can open a new terminal window, change directory to the docker-compose folder, and run:

    This stops the running services, as shown in the previous example, and removes them from memory:

  6. You can use a few more commands to explore the services when they’re running. Change directory to docker-compose before running these:

    1. Stop all the running containers:

    2. Restart the containers (after using the stop command):

    3. Starts the containers that were started with docker-compose up:

    4. Stop all running containers, and remove them and the network:

      The --rmi all option also removes the images created by docker-compose up, and the images used by any service. You can use this, for example, if any containers fail and you need to remove them:

See the Docker documentation for more on using Docker.

Deployment project in GitHub

See the Alfresco/acs-deployment GitHub project for more details.

  • In this project, you’ll find several Docker Compose files. The default docker-compose.yml file contains the latest work-in-progress deployment scripts, and installs the latest development version of Content Services.
  • To deploy a specific released version of Content Services, several major.minor Docker Compose files are provided in the docker-compose folder of the project.
  • To modify your development environment, for example to change or mount files in the existing images, you’ll have to create new custom Docker images (recommended approach). The same approach applies if you want to install AMP files into the repository and Share images. See the Customization guidelines for more.

Using one of the Enterprise Compose files in this project deploys the following system:

Configure

The Docker Compose file provides some default configuration. This section lists the full set of environment variables exposed by each of the containers in the deployment.

Windows

Alfresco Content Repository (alfresco)

PropertyDescription
JAVA_TOOL_OPTIONSAdding this environment variable, allows to set sensitive values (like passwords) that are not passed as arguments to the Java Process.
JAVA_OPTSA set of properties that are picked up by the JVM inside the container. Any Content Services property can be passed to the container using the format -Dproperty=value (e.g. -Ddb.driver=org.postgresql.Driver).

Alfresco Share (share)

PropertyDescription
JAVA_OPTSA set of properties that are picked up by the JVM inside the container
REPO_HOSTShare needs to know how to register itself with Alfresco. The default value is localhost
REPO_PORTShare needs to know how to register itself with Alfresco. The default value is 8080
CSRF_FILTER_REFERERCSRF Referrer
CSRF_FILTER_ORIGINCSRF Origin

Alfresco Search Services (solr6)

PropertyDescription
SOLR_ALFRESCO_HOSTSolr needs to know how to register itself with Alfresco. The default value is alfresco
SOLR_ALFRESCO_PORTSolr needs to know how to register itself with Alfresco. The default value is 8080
SOLR_SOLR_HOSTAlfresco needs to know how to call solr. The default value is solr6
SOLR_SOLR_PORTAlfresco needs to know how to call solr. The default value is 8983
SOLR_CREATE_ALFRESCO_DEFAULTSCreate the default alfresco and archive cores. The default value is alfresco,archive
SOLR_OPTSOptions to pass when starting the Java process
SOLR_HEAPThe Java heap assigned to Solr. The default value is 2g
SOLR_JAVA_MEMThe exact memory settings for Solr. Note that SOLR_HEAP takes precedence over this. The default value is -Xms2g -Xmx2g
MAX_SOLR_RAM_PERCENTAGEThe percentage of available memory (an integer value) to assign to Solr. Note that SOLR_HEAP and SOLR_JAVA_MEM take precedence over this. The default value is 2
SEARCH_LOG_LEVELThe root logger level (ERROR, WARN, INFO, DEBUG or TRACE). The default value is INFO
ENABLE_SPELLCHECKWhether spellchecking is enabled or not (true or false)
DISABLE_CASCADE_TRACKINGWhether cascade tracking is enabled or not (true or false). Disabling cascade tracking will improve performance, but result in some feature loss (e.g. path queries)
ALFRESCO_SECURE_COMMSWhether communication with the repository is secured (https or none). See Alfresco Search Services implementation for more details. The default value is none
SOLR_SSL_KEY_STOREPath to SSL key store. See Alfresco Search Services Docker Compose steps for more details
SOLR_SSL_KEY_STORE_PASSWORDPassword for key store. See Alfresco Search Services Docker Compose steps for more details
SOLR_SSL_KEY_STORE_TYPEKey store type. See Alfresco Search Services Docker Compose steps for more details. The default value is JCEKS
SOLR_SSL_TRUST_STOREPath to SSL trust store. See Alfresco Search Services Docker Compose steps for more details
SOLR_SSL_TRUST_STORE_PASSWORDPassword for trust store. See Alfresco Search Services Docker Compose steps for more details
SOLR_SSL_TRUST_STORE_TYPETrust store type. See Alfresco Search Services Docker Compose steps for more details. The default value is JCEKS
SOLR_SSL_NEED_CLIENT_AUTHThis variable is used to configure SSL (true or false). See Alfresco Search Services Docker Compose steps for more details
SOLR_SSL_WANT_CLIENT_AUTHThis variable is used to configure SSL (true or false). See Alfresco Search Services Docker Compose steps for more details

Customize

To customize the Docker Compose deployment, for example applying AMPs, we recommend following the best practice of creating your own custom Docker image(s). The Customization guidelines walks you through this process.

Cleanup

To bring the system down and cleanup the containers run the following command:

Troubleshooting

  1. If you have issues running docker-compose up after deleting a previous Docker Compose cluster, try replacing step 3 in the initial Docker Compose instructions with:

  2. Stop the session by using CONTROL+C.

  3. Remove the containers (using the --rmi all option):

  4. Try allocating more memory resources, as advised in docker-compose.yml.

    For example, in Docker, change the memory setting in Preferences (or Settings) Resources > Advanced > Memory to at least 8GB. Make sure you restart Docker and wait for the process to finish before continuing.

    Go back to step 3 in the initial Docker Compose instructions to start the deployment again.

Note: You’ll need a machine with at least 13GB of memory to distribute among the Docker containers.

Reference

The table below shows the location of the Dockerfile for each container used in this deployment.

ContainerDockerfile location
alfrescohttps://github.com/Alfresco/acs-packaging/blob/master/docker-alfresco/Dockerfile
sharehttps://github.com/Alfresco/share/blob/master/packaging/docker/Dockerfile
solr6https://github.com/Alfresco/InsightEngine/blob/master/search-services/packaging/src/docker/Dockerfile

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.

Libreoffice

Grab the Docker image like this:

Then start a new container, for example:

But first, please read further, about the configuration options.

How to configure collabora/code Docker image

There are multiple ways to put application configuration into Docker containers. Collabora Online has many configuration options and the Docker image comes with a built-in /etc/loolwsd/loolwsd.xml configuration file with the defaults.

1. Setting the application configuration dynamically via environment variables

After the -e command line option of docker run command you can define environment variables, that are passed to the container.

<your-dot-escaped-domain> is the WOPI host, i.e. your preferred File Sync and Share solution that implements WOPI protocol, for example share.example.com. You need double backslash in command line, because shell escapes the first, and the domain parameter takes a regular expression. Note: you can enable multiple domains by separating the domain names with character.
The optional username and password parameters enable the admin console feature of CODE. You can access the admin console at https://<CODE-domain>/loleaflet/dist/admin/admin.html.
Other optional environment variables that you can pass to collabora/code are the following:

DONT_GEN_SSL_CERTWhen this environment variable is set (is not “”), then startup script will not generate a new SSL certificate signed by a dummy CA. It is useful, if you want to use your own SSL certificate for some reason.
cert_domainWhen this environment variable is set (is not “”), then startup script will generate a new SSL certificate signed by a dummy CA for this domain, not for localhost
server_nameWhen this environment variable is set (is not “”), then its value will be used as server name in /etc/loolwsd/loolwsd.xml. Without this, CODE is not delivering a correct host for the websocket connection in case of a proxy in front of it.
dictionariesBy default only limited set of spelling dictionaries and thesauri are configured for CODE, mainly for performance reasons. The default set of languages is the following: de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru. With the dictionaries environment variable you can change this list. The dictionaries environment variable should contain the space separated list of language codes (optionally followed by country code). In order to save resources, it makes sense to load only those dictionaries that are actually needed.
extra_paramsYou can pass extra loolwsd command line parameter via this environment variable. For example, if you want to start loolwsd without SSL, when you test or develop, the syntax is: -e 'extra_params=--o:ssl.enable=false'. To learn about all possible options, refer to the self-documented /etc/loolwsd/loolwsd.xml configuration file in the Docker image.

Docker Install Libreoffice Headless

2. Use the configuration file directly

After starting the container, you can copy the configuration file out of the container, edit it, and copy it back to the container. The container will notice that the configuration file has changed, and the service will be restarted (don’t forget the --restart always option when you start the container with docker run).
1. Find out the name or hash of your container:

Libreoffice

The output would be something like this:

2. Copy out the config file:

3. Edit the config file with your favourite editor, then save and copy it back to the container:

Wait a few seconds for the the automatic restart.

Docker

Troubleshooting

Docker Install Libreoffice Download

After starting of the container, try:

You should get the OK string, if everything is in order. Otherwise you can check the log with:

(Of course instead of romantic_meninsky you’ll have something different as the output of docker ps.)

Misc

If you need customizations, for example additional fonts, you can build the docker image yourself. See the source on GitHub. Add font packages to install-libreoffice.sh script, then build a custom image.

Known problems:
  • This docker image does not work on Ubuntu 14.04 LTS, because Ubuntu 14.04 LTS has missing kernel compile option CONFIG_AUFS_XATTR=y, which is leading to setcap not working on docker’s aufs storage. Upstream bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1557776