From f9359f59a88f109a7764406c33529a20098b0c7f Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 20 Dec 2013 08:20:08 -0800 Subject: [PATCH] Add dynamic os/arch detection to Images --- graph.go | 4 +++- image.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/graph.go b/graph.go index 277bd1a55b..058ef7e93d 100644 --- a/graph.go +++ b/graph.go @@ -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 diff --git a/image.go b/image.go index 0f07a74ee8..f062910ef8 100644 --- a/image.go +++ b/image.go @@ -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 }