Add dynamic os/arch detection to Images

This commit is contained in:
Guillaume J. Charmes 2013-12-20 08:20:08 -08:00
parent e4561438f1
commit f9359f59a8
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3
2 changed files with 4 additions and 1 deletions

View file

@ -10,6 +10,7 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
@ -131,7 +132,8 @@ func (graph *Graph) Create(layerData archive.Archive, container *Container, comm
DockerVersion: VERSION,
Author: author,
Config: config,
Architecture: "x86_64",
Architecture: runtime.GOARCH,
OS: runtime.GOOS,
}
if container != nil {
img.Parent = container.Image

View file

@ -28,6 +28,7 @@ type Image struct {
Author string `json:"author,omitempty"`
Config *Config `json:"config,omitempty"`
Architecture string `json:"architecture,omitempty"`
OS string `json:"os,omitempty"`
graph *Graph
Size int64
}