Merge pull request #924 from tonistiigi/binfmt_windows

binfmt_misc: fix building on windows
docker-19.03
Akihiro Suda 2019-04-03 17:00:28 +09:00 committed by GitHub
commit b3028967ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 4 deletions

View File

@ -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
}

View File

@ -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,
}
}

View File

@ -0,0 +1,10 @@
// +build windows
package binfmt_misc
import (
"os/exec"
)
func withChroot(cmd *exec.Cmd, dir string) {
}