mirror of
https://github.com/mudler/luet.git
synced 2025-09-04 08:45:40 +00:00
Simplify delta generation, and avoid two-pass with img backend
This changeset also drops --keep-exported-images, which is quite unused and can be replaced with a plugin, or either by manually exporting the resulting images.
This commit is contained in:
@@ -184,9 +184,22 @@ type ManifestEntry struct {
|
||||
}
|
||||
|
||||
func (b *SimpleDocker) ExtractRootfs(opts compiler.CompilerBackendOptions, keepPerms bool) error {
|
||||
src := opts.SourcePath
|
||||
name := opts.ImageName
|
||||
dst := opts.Destination
|
||||
|
||||
tempexport, err := ioutil.TempDir(dst, "tmprootfs")
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Error met while creating tempdir for rootfs")
|
||||
}
|
||||
defer os.RemoveAll(tempexport) // clean up
|
||||
|
||||
imageExport := filepath.Join(tempexport, "image.tar")
|
||||
if err := b.ExportImage(compiler.CompilerBackendOptions{ImageName: name, Destination: imageExport}); err != nil {
|
||||
return errors.Wrap(err, "failed while extracting rootfs for "+name)
|
||||
}
|
||||
|
||||
src := imageExport
|
||||
|
||||
if src == "" && opts.ImageName != "" {
|
||||
tempUnpack, err := ioutil.TempDir(dst, "tempUnpack")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user