Package scripts in flatpak?

Alexander Larsson alexl at redhat.com
Mon May 8 09:24:09 UTC 2017


On Sun, 2017-05-07 at 10:11 -0700, Justin Garrison wrote:
> I have a collection of python scripts and some external 3rd party
> executables (puppet) I want to package in a portable way. I'm not
> sure flatpak is the right solution for this but I wanted to ask. The
> options I have thought of are
> Docker containerFlatpak/snap/appimageVirtualenv/software
> collectionsEach package type has pros and cons but I'd like to
> package this up so the host system needs minimal requirements but the
> scripts still have full access to the host. My main problems right
> now is trying to maintain compatibility with different versions of
> python + libraries, different versions of puppet, and different ways
> each packaged executable sees the rest of the system (e.g. docker
> container needs to mount / in a different location).
> 
> Does anyone have experience or documentation for packaging scripts
> that need system access in flatpak? Would also appreciate if anyone
> has examples I can look at or more things I should consider with the
> different formats.

This is not really the target usecase for flatpak, but it could very
well work. However, it depends a bit on what you mean by full system
access. You can easily package the python scripts and libraries in a
flatpak, and then grant that app full filesystem and network access.
However, it will not be able to see some things. For instance, /usr and
/etc will be from the runtime, not the host, and /run, /tmp, /proc etc
are specific to the sandboxed instance. /dev is too, but you can grant
access to the host dev if you need. It really depends on what you want
to do.

Also, running the scripts will be somewhat painful. Say the app is
org.my.Scripts, then you can do something like:

 flatpak run --command=script1 org.my.Scripts --args-for-script
Which is hardly ideal for CLI use. Although some aliases for this could
make it easier to use.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a sword-wielding one-eyed Green Beret trapped in a world he never 
made. She's a sarcastic French-Canadian archaeologist who dreams of 
becoming Elvis. They fight crime! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20170508/3851538f/attachment.html>


More information about the xdg-app mailing list