mirror of
https://github.com/mudler/luet.git
synced 2025-08-18 07:16:57 +00:00
Switch to ondisk also when unpacking FS
From benchmarks it seems to be still faster. Add a note for a future improvement
This commit is contained in:
parent
aea3cdff8d
commit
35fcd868ee
@ -156,7 +156,7 @@ RUN echo bar > /test2`))
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
defer os.RemoveAll(result) // clean up
|
defer os.RemoveAll(result) // clean up
|
||||||
|
|
||||||
img, err := b.ImageReference(resultingImage, false)
|
img, err := b.ImageReference(resultingImage, true)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
_, _, err = image.ExtractTo(
|
_, _, err = image.ExtractTo(
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -140,6 +140,11 @@ func (s *SimpleDocker) Push(opts Options) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SimpleDocker) ImageReference(a string, ondisk bool) (v1.Image, error) {
|
func (s *SimpleDocker) ImageReference(a string, ondisk bool) (v1.Image, error) {
|
||||||
|
// TODO: We could also handle this from docker's pipe, but needs benchmarking:
|
||||||
|
// daemon.Image takes a client optionally. Otherwise we can return a new image
|
||||||
|
// from a tarball by providing ourselves a reader from docker stdout pipe.
|
||||||
|
// See daemon.Image implementation below for an example (which returns the tarball stream
|
||||||
|
// from the HTTP api endpoint instead ).
|
||||||
if ondisk {
|
if ondisk {
|
||||||
f, err := s.ctx.Config.GetSystem().TempFile("snapshot")
|
f, err := s.ctx.Config.GetSystem().TempFile("snapshot")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -234,7 +234,7 @@ func (cs *LuetCompiler) unpackFs(concurrency int, keepPermissions bool, p *compi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img, err := cs.Backend.ImageReference(runnerOpts.ImageName, false)
|
img, err := cs.Backend.ImageReference(runnerOpts.ImageName, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user