distrobox icon indicating copy to clipboard operation
distrobox copied to clipboard

[Suggestion] Publish in SnapStore

Open krille-chan opened this issue 3 years ago • 9 comments

Is your feature request related to a problem? Please describe. Install and use Distrobox on Ubuntu Core.

Describe the solution you'd like Publish as a snap.

Describe alternatives you've considered Install from source.

Additional context Hello there :) I have a working snap version of Distrobox here: https://github.com/krillefear/distrobox and I was going to ask if you would like to officially support this. Then I would make a Pull Request and give you all information you need to automatically publish to the SnapStore from your repository. Otherwise, if it is okay I can also maintain the snap version by myself. For this I want to ask if it is okay, to use the icon and the screenshot from the readme.

krille-chan avatar Feb 06 '22 12:02 krille-chan

Hi @krillefear thanks a lot for this!

I'm not practical with snaps and don't use them a lot (more of a flatpak guy :smile: ) so probably I'm not the most indicated version to maintain it I have no problems for you to use stuff from readme and icons all long as it points back to this project obviously 😄

I have some questions about this

  • will this be a classical snap? For integration to work it needs access to /run, /home and at least read-only to whole /
  • how does it hanlde dependencies? I know that snaps much like flatpaks arenan all-in-one package, so how does it handle podman/docker? If it does not handle that is this considered a good practice in the snap world to mix snap with other apt/dpkg dependencies?

Thanks!

89luca89 avatar Feb 06 '22 16:02 89luca89

Hey, thanks for the response. Currently it is a very lazy snap. It does not ship docker or podman and requires the user to install docker or podman in another way. I have tested it with the Docker Snap version but this worked not good. APT installed docker was much better.

But because of this, there are no dependencies. So it's very easy. The snapcraft build process just clones the repository and executes the install script.

krille-chan avatar Feb 06 '22 21:02 krille-chan

Ok @krillefear I'd like to see if we can make it work with snap's docker or podman (if exists) so that it acts like the RPM version (both Suse and Fedora) where it pulls it's own dependencies if needed (podman/docker)

89luca89 avatar Feb 07 '22 09:02 89luca89

Sorry :-( I have tried hard to install docker or podman inside of the snap but I failed. I still don't understand how binaries are linked inside of the snap though... the only way I found this working was to install distrobox in classic mode and then install docker or podman from somewhere else on the system and then this will be used.

krille-chan avatar Feb 12 '22 10:02 krille-chan

At least if docker is installed in classic mode as well, it can be used with it. So it comes down to:

snap install distrobox --classic
snap install docker --classic

And it seems to work fine :) I can access all files in home

edit: Whoa! I can even install graphical programs which integrate quiet nice with the system

krille-chan avatar Feb 12 '22 11:02 krille-chan

Cool :-) Is it possible to specify docker classic as a dependency of distrobox? So that when you snap install it, it will also pull docker snap?

89luca89 avatar Feb 12 '22 11:02 89luca89

Sorry, no that would install docker in normal mode. To install it in classic mode, the user needs to do additional stuff. I have the hope that with Core22 I can just add podman as a dependency in the distrobox snap and then it works ootb

krille-chan avatar Feb 14 '22 10:02 krille-chan

Cool, let's see it this works then 😄

89luca89 avatar Feb 14 '22 14:02 89luca89

Heads up, next version will include #190 This will DEPRECATE the use of --path/-p in favor of --prefix/-P to behave similar to makefiles. This way you specify only the base path where bin and man will be installed, for example

./install --prefix /usr/local

89luca89 avatar Feb 26 '22 10:02 89luca89

Depending on how you execute docker, you can "depend" on the published interfaces and use docker's content interfaces to get access to the docker binary and socket. It is not a dependency in the classical sense, because you can disconnect your snap from docker and connect it to another provider with the same interface.

I had a quick look online and I found this repo: https://github.com/dilyn-corner/example-docker-snap

Separately I think it would be good to contribute a dedicated article to the snapcraft documentation, on how to use docker in your own snap this way.

zyga avatar Feb 16 '24 07:02 zyga