OSX compilation

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@dotcloud.com> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-02-19 16:50:10 -08:00 committed by Michael Crosby
parent b992a5342f
commit 51b1a2c1c9
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,5 @@
// +build linux
package main
import (

View File

@ -1,3 +1,5 @@
// +build linux
package main
import (

View File

@ -2,17 +2,27 @@ package main
import (
"encoding/json"
"errors"
"github.com/dotcloud/docker/pkg/libcontainer"
"log"
"os"
)
var (
ErrUnsupported = errors.New("Unsupported method")
ErrWrongArguments = errors.New("Wrong argument count")
)
func main() {
container, err := loadContainer()
if err != nil {
log.Fatal(err)
}
argc := len(os.Args)
if argc < 2 {
log.Fatal(ErrWrongArguments)
}
switch os.Args[1] {
case "exec":
exitCode, err := execCommand(container)
@ -21,6 +31,9 @@ func main() {
}
os.Exit(exitCode)
case "init":
if argc != 3 {
log.Fatal(ErrWrongArguments)
}
if err := initCommand(container, os.Args[2]); err != nil {
log.Fatal(err)
}

View File

@ -1,3 +1,5 @@
// +build linux
package main
import (