Add CreateTar to image API

Add api call which uses go-container registry to create OCI images from
standard tar archives.

Consume new API when generating final images instead of docker building them
and adapts/add tests as necessary.

This change now allows to carry over xattrs to final images.

Fixes #266
This commit is contained in:
Ettore Di Giacinto
2021-10-28 23:42:06 +02:00
parent 1b35a674ea
commit c7f9708f90
16 changed files with 308 additions and 71 deletions

View File

@@ -17,7 +17,6 @@ package image
import (
"encoding/json"
"fmt"
"os"
"strings"
@@ -156,10 +155,7 @@ func (c *Cache) All(fn func(CacheResult)) {
}
for key := range c.store.Keys(nil) {
val, err := c.store.Read(key)
if err != nil {
panic(fmt.Sprintf("key %s had no value", key))
}
val, _ := c.store.Read(key)
fn(CacheResult{key: key, value: string(val)})
}
}