mirror of
https://github.com/mudler/luet.git
synced 2025-09-02 15:54:39 +00:00
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:
@@ -71,6 +71,17 @@ func (s *SimpleDocker) CopyImage(src, dst string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SimpleDocker) LoadImage(path string) error {
|
||||
s.ctx.Debug(":whale: Loading image:", path)
|
||||
cmd := exec.Command("docker", "load", "-i", path)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed loading image: "+string(out))
|
||||
}
|
||||
s.ctx.Success(":whale: Loaded image:", path)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SimpleDocker) DownloadImage(opts Options) error {
|
||||
name := opts.ImageName
|
||||
bus.Manager.Publish(bus.EventImagePrePull, opts)
|
||||
|
@@ -35,6 +35,10 @@ func NewSimpleImgBackend(ctx *types.Context) *SimpleImg {
|
||||
return &SimpleImg{ctx: ctx}
|
||||
}
|
||||
|
||||
func (s *SimpleImg) LoadImage(string) error {
|
||||
return errors.New("Not supported")
|
||||
}
|
||||
|
||||
// TODO: Missing still: labels, and build args expansion
|
||||
func (s *SimpleImg) BuildImage(opts Options) error {
|
||||
name := opts.ImageName
|
||||
|
Reference in New Issue
Block a user