It looks like there are two main issues based on the logs:
-
Permission Denied Errors: The container is failing to create necessary files like
key.pem,cert.pem, andca-chain.cert.pemin/etc/coolwsd/. This is likely a permissions issue on the mounted volume, as Docker containers can sometimes have issues with file ownership and permissions, especially when dealing with root-owned directories on the host. -
Missing
coolwsd.xmlFile: The errorFailed to initialize COOLWSD: File not found: /etc/coolwsd/coolwsd.xmlsuggests that the container expects a validcoolwsd.xmlto exist in the mounted directory, but it cannot find it or lacks permission to access it.
Solution Steps:
Step 1: Fix Permissions on the Mounted Volume
Since you’re mounting /var/container/collabora/etc/coolwsd/ to /etc/coolwsd/ in the container, the container needs read and write permissions for that directory. To ensure the container has the correct permissions, you can change the owner of the directory to match the container’s user or set appropriate permissions.
Run the following command to adjust the permissions of the directory:
sudo chown -R 101:101 /var/container/collabora/etc/coolwsd/
This command sets the ownership of the directory to user 101, which is the UID typically used by the Collabora CODE container. You may also want to set write permissions to ensure the container can create necessary files:
sudo chmod -R 755 /var/container/collabora/etc/coolwsd/
Step 2: Ensure coolwsd.xml Exists
The error about the missing coolwsd.xml file indicates the file might be missing in your mounted directory. You can copy a default coolwsd.xml from the container to your host to get started.
To extract the default configuration:
- Start the container without the volume mount:
docker run --name temp-collabora --rm collabora/code
- Copy the
coolwsd.xmlfile from the container:
docker cp temp-collabora:/etc/coolwsd/coolwsd.xml /var/container/collabora/etc/coolwsd/coolwsd.xml
- Stop the container:
docker stop temp-collabora
Now that you have a valid coolwsd.xml file in place, you can try running your docker-compose setup again.
Step 3: Update Docker Compose File
Your Docker Compose file looks good, but make sure the volumes section points to the correct location. Here’s the finalized version:
version: '3'
services:
collabora:
image: collabora/code
container_name: collabora
ports:
- "9980:9980"
restart: unless-stopped
volumes:
- /var/container/collabora/etc/coolwsd/:/etc/coolwsd/:rw
environment:
- domain=office.mydomain.online
- username=xxxx
- password=xxxxx
- dictionaries=en_US
- TZ=Asia/Kolkata
Step 4: Restart the Container
Once you’ve ensured the permissions are set and the coolwsd.xml file exists, you can restart the container:
docker-compose up -d
Debugging
- If the container still fails to start, check the logs again for any further permission issues or errors:
docker logs collabora
- You can also enter the container and inspect the files to ensure everything is in place:
docker exec -it collabora /bin/bash
From there, you can check the contents of /etc/coolwsd/ to verify that the mounted volume and files are accessible.
Let me know how this works for you!