nut icon indicating copy to clipboard operation
nut copied to clipboard

Create container once, then reuse it

Open matthieudelaro opened this issue 8 years ago • 3 comments

So far, nut creates/removes a new container for each call to nut. This is fast, but the user can still notice it when he runs a command.

To solve this, nut should create the container, and store its ID in .nut folder (by improving Store defined in module nut/persist). Then use the same container each time nut is called. This container should be removed when nut --clean is called.

matthieudelaro avatar Apr 18 '16 12:04 matthieudelaro

@matthieudelaro: any updates on this issue? This would also be helpful when I was to keep the environment state between nut runs.

johnjelinek avatar Jan 25 '17 20:01 johnjelinek

Hi,

No, I hadn't time to work on it. Last year I began to create a skeleton to read/write key/values (to store the container ID) in the .nut folder (https://github.com/matthieudelaro/nut/blob/master/persist/persist.go#L88). But I thought using a Go library would be much easier. Which one? Well, I took a look at a couple of them, but I wasn't convinced by any of them (cross-platform issues, very big libraries for such feature, ...) If you've ever stored such things in Go, I guess it's pretty easy to implement the feature. Have you ever experimented such storage library?

matthieudelaro avatar Jan 26 '17 09:01 matthieudelaro

I think the standard lib should give you everything you need to persist key/values unless you want something like an embedded database or something fancy like that.

On Jan 26, 2017 3:41 AM, "matthieudelaro" [email protected] wrote:

Hi,

No, I hadn't time to work on it. Last year I began to create a skeleton to read/write key/values (to store the container ID) in the .nut folder ( https://github.com/matthieudelaro/nut/blob/master/persist/persist.go#L88). But I thought using a Go library would be much easier. Which one? Well, I took a look at a couple of them, but I wasn't convinced by any of them (cross-platform issues, very big libraries for such feature, ...) If you've ever stored such things in Go, I guess it's pretty easy to implement the feature. Have you ever experimented such storage library?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matthieudelaro/nut/issues/3#issuecomment-275346120, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1UijNqsHkMJ-vEPiDIfn4w6RU5oi6oks5rWGpQgaJpZM4IJrXj .

johnjelinek avatar Jan 26 '17 14:01 johnjelinek