img icon indicating copy to clipboard operation
img copied to clipboard

Snap package

Open bashfulrobot opened this issue 7 years ago • 16 comments

To further a discussion that I had on Twitter... I'm simply opening this issue to both coordinate and track the progress of building a snap package.

The very first question is... Do you prefer to have the binary that you built packaged up? Or built from Source? Either can be done. It really depends on your preferences. For example when I did The Restic package - they wanted to use the binary that they built.

The preferred method would be to build from source so that build.snapcraft.io could be leveraged. And if we do that, it can be connected it to your GitHub account to build and deploy into the "edge" channel automatically when you check in code.

Thoughts?

bashfulrobot avatar Jun 06 '18 14:06 bashfulrobot

Since this is work that I'm doing, feel free to assign this task to me.

bashfulrobot avatar Jun 06 '18 14:06 bashfulrobot

Thanks so much for this!

jessfraz avatar Jun 06 '18 15:06 jessfraz

No problem! What I think I am going to do is get one built from your release binaries, and then move over to an actual build from the build service. Or do you have a preference? Some authors prefer to just wrap their binaries. But if it is built from source - it can autorelease to the edge channel and is less "manual" work in the future.

bashfulrobot avatar Jun 12 '18 20:06 bashfulrobot

One other question for you. As I register this in the snap store, do you prefer it to go under the name img (still available), or as something like genuinetools-img (the command would still be img)?

bashfulrobot avatar Jun 12 '18 20:06 bashfulrobot

Update (am I annoying you yet)? ha.

Note - The only reason the below install command is with the dangerous flag is due to it being a local install and not published in the snap store.

sudo snap install --dangerous --devmode img_0.4.6_amd64.snap 
img 0.4.6 installed
 dkrysak >> ~/Documents/Projects/snaps/snapcrafters-img >> img --version
--version: no such command
Usage: img <command>

Commands:

  build    Build an image from a Dockerfile.
  du       Show image disk usage.
  ls       List images and digests.
  login    Log in to a Docker registry.
  prune    Prune and clean up the build cache.
  pull     Pull an image or a repository from a registry.
  push     Push an image or a repository to a registry.
  rm       Remove one or more images.
  save     Save an image to a tar archive (streamed to STDOUT by default).
  tag      Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE.
  unpack   Unpack an image to a rootfs directory.
  version  Show the version information.

This is now installed on my system (local) and showing the binary working and in the path on my system.

Once I hear back on your naming preferences, I can register the snap name.

Thanks.

Edit - Proper version output.

# img version
img:
 version     : v0.4.6
 git hash    : 9c9f6f6
 go version  : go1.10.3
 go compiler : gc
 platform    : linux/amd64

bashfulrobot avatar Jun 12 '18 20:06 bashfulrobot

Awesome!!!! Thanks!!

jessfraz avatar Jun 13 '18 18:06 jessfraz

img is great! Sweet then we can add it to the readme :)

jessfraz avatar Jun 13 '18 18:06 jessfraz

Hi @jessfraz I just pushed the latest release to the edge channel. This is just meant to test at the moment. It is currently just built from your release binary. Note that once flagged as good to go, if installed from the edge channel, the snap would only refresh (update) from there.

Install from the edge channel

$ sudo snap install img --channel edge
img (edge) 0.4.6 from 'bashfulrobot' installed

Default install

sudo snap install img

Swap between channels

sudo snap refresh img --channel=<channel_name>
# Valid channels - stable, candidate, beta, edge

Version Output

$ img version
img:
 version     : v0.4.6
 git hash    : 9c9f6f6
 go version  : go1.10.3
 go compiler : gc
 platform    : linux/amd64

Check out info on the snap

Note - I need to update the licensing info in the package.

snap info img
name:      img
summary:   Unprivileged Dockerfile & OCI compatible container img builder.
publisher: bashfulrobot
license:   unknown
description: |
  "Standalone, daemon-less, unprivileged Dockerfile and OCI compatible
  container image builder.
  
  img is more cache-efficient than Docker and can also execute multiple build
  stages concurrently, as it internally uses BuildKit's DAG solver.
  
  The commands/UX are the same as docker {build,tag,push,pull,login,save} so
  all you have to do is replace docker with img in your scripts, command
  line, and/or life."
commands:
  - img
snap-id:      AxVc8xp7iY26KI1CaXlYlTXCR4OXfaBn
tracking:     edge
refresh-date: today at 10:00 PDT
channels:                  
  stable:    –             
  candidate: –             
  beta:      –             
  edge:      0.4.6 (1) 7MB -
installed:   0.4.6 (1) 7MB -
``
Longer term is this something that you would like to officially support in your offering? If so I would likely change it over to build from source and we could wire it into the build system. And we would transfer the package name over to the "official" entity.

bashfulrobot avatar Jun 23 '18 17:06 bashfulrobot

Is there a specific logo or anything I should use for the icon in the snap store? Any particular screenshots?

bashfulrobot avatar Jun 23 '18 17:06 bashfulrobot

oh we don't have a logo sorry

jessfraz avatar Jun 25 '18 15:06 jessfraz

this is awesome tho!!

jessfraz avatar Jun 25 '18 15:06 jessfraz

we should add it to the readme :)

jessfraz avatar Jun 25 '18 15:06 jessfraz

There is a simple “gt” image located on https://github.com/genuinetools... I’ll grab that to use for now. I’ll throw a simple screenshot of the version output and then add some of the above notes to the readme via a PR.

bashfulrobot avatar Jun 26 '18 03:06 bashfulrobot

@jessfraz - sorry, job change/ life hit me. Picking this up again.

bashfulrobot avatar Nov 15 '18 00:11 bashfulrobot

It is recently updated to snapcraft 3, just fixing up a few depreciated snapcraft YAML changes and just pinging to let you know that I'm in the home stretch for the much-needed updates.

bashfulrobot avatar Jan 10 '20 05:01 bashfulrobot

@jessfraz - https://snapcraft.io/img

This is published now. Sorry about the insanely long process.

Right now the app (due to confinement) can access files in a users home folder. Is that a show stopper?

Edit - Hit an issue. Might be some of my own inexperience with the tool. :crying_cat_face: (back to logs)

bashfulrobot avatar Apr 22 '20 22:04 bashfulrobot