[19.03] vendor: buildkit v0.6.4-5-g59e305aa

full diff: b26cff2413...59e305aa33

- moby/buildkit#1469 Avoid creation of irrelevant temporary files on Windows
    - backport of moby/buildkit#1462 for the docker-19.03/v0.6 branch

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-04-30 17:13:00 +02:00
parent 2fbb374ab7
commit 63841af153
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
4 changed files with 43 additions and 43 deletions

View file

@ -26,7 +26,7 @@ github.com/imdario/mergo 7c29201646fa3de8506f70121347
golang.org/x/sync e225da77a7e68af35c70ccbf71af2b83e6acac3c
# buildkit
github.com/moby/buildkit b26cff2413cc6a466f8739262efa13bd126f8fc7 # v0.6.4 + aa7df97d7136e732561b59f87a38ad52d46d3b19
github.com/moby/buildkit 59e305aa33fd96e51d5c458f55104250b3e39f56 # v0.6.4-5-g59e305aa
github.com/tonistiigi/fsutil 6c909ab392c173a4264ae1bfcbc0450b9aac0c7d
github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7

View file

@ -1,42 +0,0 @@
package binfmt_misc
import (
"bytes"
"compress/gzip"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
)
func check(bin string) error {
tmpdir, err := ioutil.TempDir("", "qemu-check")
if err != nil {
return err
}
defer os.RemoveAll(tmpdir)
pp := filepath.Join(tmpdir, "check")
r, err := gzip.NewReader(bytes.NewReader([]byte(bin)))
if err != nil {
return err
}
defer r.Close()
f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700)
if err != nil {
return err
}
if _, err := io.Copy(f, r); err != nil {
f.Close()
return err
}
f.Close()
cmd := exec.Command("/check")
withChroot(cmd, tmpdir)
err = cmd.Run()
return err
}

View file

@ -3,7 +3,13 @@
package binfmt_misc
import (
"bytes"
"compress/gzip"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"syscall"
)
@ -12,3 +18,34 @@ func withChroot(cmd *exec.Cmd, dir string) {
Chroot: dir,
}
}
func check(bin string) error {
tmpdir, err := ioutil.TempDir("", "qemu-check")
if err != nil {
return err
}
defer os.RemoveAll(tmpdir)
pp := filepath.Join(tmpdir, "check")
r, err := gzip.NewReader(bytes.NewReader([]byte(bin)))
if err != nil {
return err
}
defer r.Close()
f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700)
if err != nil {
return err
}
if _, err := io.Copy(f, r); err != nil {
f.Close()
return err
}
f.Close()
cmd := exec.Command("/check")
withChroot(cmd, tmpdir)
err = cmd.Run()
return err
}

View file

@ -3,8 +3,13 @@
package binfmt_misc
import (
"errors"
"os/exec"
)
func withChroot(cmd *exec.Cmd, dir string) {
}
func check(bin string) error {
return errors.New("binfmt is not supported on Windows")
}