Merge pull request #924 from tonistiigi/binfmt_windows
binfmt_misc: fix building on windowsdocker-19.03
commit
b3028967ae
|
@ -8,7 +8,6 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func check(bin string) error {
|
||||
|
@ -37,9 +36,7 @@ func check(bin string) error {
|
|||
f.Close()
|
||||
|
||||
cmd := exec.Command("/check")
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Chroot: tmpdir,
|
||||
}
|
||||
withChroot(cmd, tmpdir)
|
||||
err = cmd.Run()
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// +build !windows
|
||||
|
||||
package binfmt_misc
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func withChroot(cmd *exec.Cmd, dir string) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Chroot: dir,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
// +build windows
|
||||
|
||||
package binfmt_misc
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func withChroot(cmd *exec.Cmd, dir string) {
|
||||
}
|
Loading…
Reference in New Issue