OSX compilation
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@dotcloud.com> (github: creack)
This commit is contained in:
parent
84ba029e25
commit
b48bc85967
4 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in a new issue