flathub / com.wps.Office

https://flathub.org/apps/details/com.wps.Office
24 stars 15 forks source link

flatpak WPS in Dockerfile #113

Closed gpopesc closed 3 years ago

gpopesc commented 3 years ago

Hello

I am trying to install flatpak with WPS in docker container and build the application in Dockerfile based on ubuntu 20.04. I managed to install flatpak, but when I try to instrall WPS office I get this warning: bwrap: Creating new namespace failed: Operation not permitted Warning: While trying to apply extra data: apply_extra script failed, exit status 256

then in next step I get: error: Failed to install com.wps.Office: While trying to apply extra data: apply_extra script failed, exit status 256 The command '/bin/sh -c flatpak install flathub com.wps.Office -y' returned a non-zero code: 1

On the other hand, if I install other apps like chess in flatpak I got only the first warning and the apps was installed.

Any ideas how to solve this error?

Thanks

tinywrkb commented 3 years ago

You need to run in privileged container or add the proper capabilities needed for user namespaces.
In rootful container, this means adding the --privileged=true option.
In rootless container, add --cap-add=NET_ADMIN --cap-add=CAP_SYS_ADMIN options.

gpopesc commented 3 years ago

thank you @tinywrkb for your advice.

what I discovered:

Finally after installation I had to copy desktop icons and mount home inside flatpak sudo cp /var/lib/flatpak/exports/share/applications/*wps*.desktop /usr/share/applications/ sudo flatpak override com.wps.Office --filesystem=home

I am not very happy with so many rights assigned to the container, but otherwise it is not working. On the other hand it is self build and I know that it safe.

The new version of WPS office(from August) can be installed in docker only with flatpak as described above. The standard version from website with deb file it is not running and it doesn't return any errors.