mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add dynamic os/arch detection to Images
This commit is contained in:
parent
e4561438f1
commit
f9359f59a8
2 changed files with 4 additions and 1 deletions
4
graph.go
4
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
|
||||
|
|
1
image.go
1
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue