CODE Docker image
The CODE Docker image can be installed to any x86-64 or arm64 host, and it is fully configurable.
How to grab the CODE image from Docker image
Collabora Online Development Edition (CODE) is available as a Docker image from Docker Hub. Currently, the supported platforms are x86-64 and arm64, 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.
docker pull collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 -e "domain=<your-dot-escaped-domain>" -e "username=admin" -e "password=S3cRet" --restart always collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 -e "aliasgroup1=https://<domain1>:443,https://<your-dot-escaped-aliasname1>|<your-dot-escaped-aliasname2>:443" -e "aliasgroup2=https://<domain2>:443" -e "username=admin" -e "password=S3cRet" --restart always collabora/code
Note: for the faster jail creation via bind mount, you need to use docker run
command with the --privileged flag
.
How to configure 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/coolwsd/coolwsd.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.|
character. The optional username
and password
parameters enable the admin console feature of CODE.aliasgroup1=https://<domain1>:443,https://<your-dot-escaped-aliasname1>|<your-dot-escaped-aliasname2>:443
, aliasgroup1, aliasgroup2…. so on should be added as per the requirement.<domain1>
is the WOPI host, i.e. your preferred File Sync and Share solution that implements WOPI protocol, for example share.example.com
.<your-dot-escaped-aliasname1>|<your-dot-escaped-aliasname2>
are the aliasname with which you can access the same WOPI host(in this case <domain1>
) with multiple names, aliasname accepts regex.If you don’t have any aliases then only domain needs to be defined, for example aliasgroup2=https://<domain2>:443
. https://<CODE-domain>/browser/dist/admin/admin.html
Other optional environment variables that you can pass to collabora/code
are the following:
|
User name for the Admin Console |
|
Password for the Admin Console |
|
When 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. |
|
When 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
|
|
When this environment variable is set (is not “”), then its value will be used as server name in
|
|
By 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: |
|
You can pass extra command line parameters to |
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
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a4633c28c690 collabora/code "/bin/sh -c 'bash ..." 5 seconds ago Up 4 seconds 127.0.0.1:9980->9980/tcp romantic_meninsky
2. Copy out the configuration file
docker cp romantic_meninsky:/etc/coolwsd/coolwsd.xml coolwsd.xml
3. Edit, save and copy configuration file
chmod 644 coolwsd.xml
docker cp coolwsd.xml romantic_meninsky:/etc/coolwsd/coolwsd.xml
Wait a few seconds for the automatic restart.
Troubleshooting
After starting of the container, try:
curl -k https://localhost:9980
You should get the OK string, if everything is in order. Otherwise, you can check the log with:
docker logs romantic_meninsky
(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 the install-collabora-online-ubuntu.sh or install-collabora-online-rhel8.sh script, then build a custom image.